diff --git a/CHANGELOG.md b/CHANGELOG.md index b1433312..3bf02a43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This file is used to document any relevant changes done to libphorward. Released on: April 17, 2018 +- v0.22.3: Updated documentation, thanks to AGS - v0.22.2: inline-symbols incorrectly implemented in pbnf - v0.22.1: Build-system fixes (Windows only) - v0.22.1: pgetline() function as POSIX compatiblity layer diff --git a/Version b/Version index 25d3ccce..f44d128b 100755 --- a/Version +++ b/Version @@ -1,4 +1,4 @@ #!/bin/sh -echo "0.22.2" +echo "0.22.3" # When changing version number, remove src/version.h to regenerate it! diff --git a/configure b/configure index df1c572e..87da9ef9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Phorward Toolkit 0.22.2. +# Generated by GNU Autoconf 2.69 for Phorward Toolkit 0.22.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Phorward Toolkit' PACKAGE_TARNAME='phorward-toolkit' -PACKAGE_VERSION='0.22.2' -PACKAGE_STRING='Phorward Toolkit 0.22.2' +PACKAGE_VERSION='0.22.3' +PACKAGE_STRING='Phorward Toolkit 0.22.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1316,7 +1316,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Phorward Toolkit 0.22.2 to adapt to many kinds of systems. +\`configure' configures Phorward Toolkit 0.22.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1387,7 +1387,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Phorward Toolkit 0.22.2:";; + short | recursive ) echo "Configuration of Phorward Toolkit 0.22.3:";; esac cat <<\_ACEOF @@ -1498,7 +1498,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Phorward Toolkit configure 0.22.2 +Phorward Toolkit configure 0.22.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1917,7 +1917,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Phorward Toolkit $as_me 0.22.2, which was +It was created by Phorward Toolkit $as_me 0.22.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2784,7 +2784,7 @@ fi # Define the identity of the package. PACKAGE='phorward-toolkit' - VERSION='0.22.2' + VERSION='0.22.3' cat >>confdefs.h <<_ACEOF @@ -13392,7 +13392,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Phorward Toolkit $as_me 0.22.2, which was +This file was extended by Phorward Toolkit $as_me 0.22.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13449,7 +13449,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Phorward Toolkit config.status 0.22.2 +Phorward Toolkit config.status 0.22.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ad9118cb..f97f7cc3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.68]) -AC_INIT([Phorward Toolkit], [0.22.2]) +AC_INIT([Phorward Toolkit], [0.22.3]) AC_PREFIX_DEFAULT([/usr]) AC_CONFIG_SRCDIR([src/phorward.tpl.h]) diff --git a/doc/phorward.html b/doc/phorward.html index 6d7f5a05..a25b485e 100644 --- a/doc/phorward.html +++ b/doc/phorward.html @@ -13,8 +13,8 @@
-parray forms a data management container for handling homogenious elements of the same size in a dynamic way. These elements can be atomic data types, pointers or structures. Elements are automatically allocated with a specified chunk-size, and can be appended or prepended to the given parray object. +parray forms a data management container for handling homogeneous elements of the same size in a dynamic way. These elements can be atomic data types, pointers or structures. Elements are automatically allocated with a specified chunk-size, and can be appended or prepended to the given parray object.
The parray object brings the following advantages and disadvantages: @@ -928,11 +928,11 @@
-Quick access to the first or last elements is gained by parray_last() and parray_first(). +Quick access to the first or last element is gained by parray_last() and parray_first().
To get a predecessor or successor of an element, use parray_prev() respectively parray_next(). @@ -1122,7 +1122,7 @@
-Next to the parray object, the plist object is a powerful C implementation of a double-linked list with some extra features. It is also used for handling homogenious elements of the same size in a dynamic way, and can be used for many tasks. +Next to the parray object, the plist object is a powerful C implementation of a double-linked list with some extra features. It is also used for handling homogeneous elements of the same size in a dynamic way, and can be used for many tasks.
plist can be seen as a superset of the parray object, because it features nearly the same operations but with other underlying data management methods. @@ -1206,7 +1206,7 @@
-Elements within a plist object are references by plistel items. To access the data element behind a plistel item, the function plist_access() is used, in combination with element retrival functions, like +Elements within a plist object are referenced by plistel items. To access the data element behind a plistel item, the function plist_access() is used, in combination with element retrival functions, like
-plist objects provide a sorting automatism, so that elements can be sorted on demand or on the fly at each element insertation. +plist objects provide a sorting automatism, so that elements can be sorted on demand or on the fly at each element insertion.
The sorting order and rule is defined using an element comparison callback-function, which returns element lower, greater or equality like strcmp() does. -This function can be individually set using plist_set_sortfn(), and defaultly points to a callback function that uses memcmp() as the element comparison function. +This function can be individually set using plist_set_sortfn(), and by default points to a callback function that uses memcmp() as the element comparison function.
As prototype and example, the following comparison function: @@ -1398,7 +1398,7 @@
-This can, than, be attached to the plist object with +This can then be attached to the plist object with
@@ -1407,7 +1407,7 @@ Sorting elements
To configure a plist object to be auto-sorted, the flag PLIST_MOD_AUTOSORT should be used at construction.
-The sorting can be also be performed by invoking the functions
+Sorting can also be performed by invoking the functions
@@ -1457,7 +1457,7 @@ pccl: Character-classes
These functions are heavily used by the library's regular expressions and parser implementations, but may also be helpful for other related projects. The pccl can handle character classes, by chaining ranges.
-It supports a fully-fledged set theory automatism, including construction of intersections, unions, range removal or appending. pccl objects are designed to work on huge alphabets with a low memory consumption. By default, characters are specified as wchar_t (wide-character unicode) values.
+It supports a fully-fledged set theory automatism, including construction of intersections, unions, range removal or appending. pccl objects are designed to work on huge alphabets with low memory consumption. By default, characters are specified as wchar_t (wide-character unicode) values.
@@ -1475,7 +1475,7 @@ pccl: Character-classes
-The libphorward serves as a parser generator and language processing toolchain. It provides a flexible, integrated and consequent solution for many parsing-reated issues. +libphorward serves as a parser generator and language processing toolchain. It provides a flexible, integrated and consequent solution for many parsing-related issues.
-Grammars are described using ppgram objects, which in turn are build from terminal and nonterminal symbols, described by ppsym, and productions, described by ppprod. +Grammars are described using ppgram objects, which in turn are built from terminal and nonterminal symbols, described by ppsym, and productions, described by ppprod.
Whether a symbol is a terminal or a nonterminal is defined by its identifying name. Any symbol starting with a lower-case character in its name is identified as a nonterminal symbol. Symbols with an upper-case character or any other non-alphabetic character, as well as symbols entirely without an identifiying name, are treated as terminal symbols. @@ -2278,7 +2278,7 @@
-This example defines an (ambigous) grammar for floating-point numbers: +This example defines an (ambiguous) grammar for floating-point numbers:
@@ -2289,10 +2289,10 @@ Extended BNF
Phorward BNF
-The most powerful parser for grammars is the Phorward BNF parser (PBNF). This part of the Phorward library is still under construction and will be enhanced in future to more features and elements.
+The most powerful parser for grammars is the Phorward BNF parser (PBNF). This part of the Phorward library is still under construction and will be enhanced in the future to more features and elements.
-Additional to the EBNF syntax, this dialect enables to define
+In addition to the EBNF syntax, this dialect enables to define
@@ -2332,7 +2332,7 @@ Phorward BNF
Associativity and precedence operators
-With pbnf, and in combination with the LALR parser, precedence and associativity can also be used to resolve conflicts and write shorter grammars. Thus, the following version of the four-function calculator yields in the same parser.
+With pbnf, in combination with the LALR parser, precedence and associativity can also be used to resolve conflicts and write shorter grammars. Thus, the following version of the four-function calculator yields the same parser.
@@ -2402,7 +2402,7 @@ Parsers
as lexical analyzer, a plex object is used and managed, but this can also be changed to any other token emitting process,
-as parsing algorithm, so far only LALR(1) is supported, but more algorithms are planned in future.
+ as parsing algorithm, so far only LALR(1) is supported, but more algorithms are planned in the future.
@@ -2422,7 +2422,7 @@ Parsers
-The current state of Phorward's internal parsing tools runs on strings (char*) only. Later extensions and enhancements may provide facilities to read from files or streams.
+The current state of Phorward's internal parsing tools run on strings (char*) only. Later extensions and enhancements may provide facilities to read from files or streams.
Abstract Syntax Tree
@@ -2459,7 +2459,7 @@ Abstract Syntax Tree
-It is usually not constructed by hand, but by parsing functions while or after parsing has completed.
+It is usually not constructed by hand, but by parsing functions during parsing or when parsing has completed.
The following functions may be interesting:
@@ -2510,7 +2510,7 @@
Advanced memory management functions
Extended string processing functions
-The libphorward provides a set of functions for extended, dynamic string memory handling. These functions are named according to their standard C library counterparts, with a preceded "p", or introduce entirely new features.
+libphorward provides a set of functions for extended, dynamic string memory handling. These functions are named according to their standard C library counterparts with an added prefix ("p"), or introduce entirely new features.
String functions overview:
@@ -2527,7 +2527,7 @@
Extended string processing functions
pstrget() - securely get string from a pointer,
-pstrlen() - return length ot string, also accepts NULL-pointers,
+ pstrlen() - return length of string, also accepts NULL-pointers,
pstrltrim() - remove prefixing whitespace,
@@ -2579,7 +2579,7 @@ Extended string processing functions
-Althought the wide-character pendants to the standard extended string functions are not consistent right now, they may be extended in the future, when the existence of such functions is needed, or another, brave programmer is having the fun to implement them.
+Although the wide-character pendants to the standard extended string functions are not consistent right now, they may be extended in the future, when the existence of such functions is needed, or another, brave programmer is having the fun to implement them.
System-related functions
@@ -2604,7 +2604,7 @@ System-related functions
Boolean data type
-libphorward makes a heavy usage of the self-hosted data-type pboolean, which is also referenced by a define BOOLEAN, and the constants TRUE and FALSE.
+libphorward makes heavy usage of the self-hosted data-type pboolean, which is also referenced by a define BOOLEAN, and the constants TRUE and FALSE.
It is known, that several header files and projects define these constants on their own, so that pboolean, the data-type, exists on its own using the p-prefix, but any of the defines are conditionally flagged with
@@ -2623,7 +2623,7 @@
Boolean data type
Debug and trace facilities
-Althought this option is not widely used in modern C/C++ projects, libphorward offers an own debug and trace facility that can be turned on for modules for detecting bugs or view the program trace.
+Although this option is not widely used in modern C/C++ projects, libphorward offers an own debug and trace facility that can be turned on for modules to detect bugs or view the program trace.
For this, the library provides the following macros:
@@ -2681,7 +2681,7 @@
Debug and trace facilities
-Trace is written to stderr, and only will be compiled into the executable code if the DEBUG preprocessor-flag is defined with a value > 0. +Trace is written to stderr, and will be compiled into the executable code if the DEBUG preprocessor-flag is defined with a value > 0.
Calling this function with @@ -2940,7 +2940,7 @@
The PARMS-macro is used to write parameter names and values to the program trace. PARMS() should - by definition - only be used right behind PROC(). -If the logging of variable values is wanted during a function exection to +If the logging of variable values is wanted during a function execution to trace, the VARS()-macro shall be used.
@@ -3110,7 +3110,7 @@
var_name is the name of the variable format is a printf-styled format placeholder. -variable is the the parameter itself. +variable is the parameter itself.
-Checks if the character-classes l and r are in the same -character universe and compatible for operations. +Checks if the character-classes l and r are configured +to be in the same character universe and compatible for operations.
Returns the total number of characters the class is holding.
+min and max can either be specified as -1, so the configured default +constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted. +
+Returns a pointer to the newly created character-class. This pointer should be released with p_ccl_free() when its existence is no longer required.
-The function sets a character-class to zero, as it continas no character range +The function sets a character-class to zero, as it contains no character range definitions. The object ccl will be still alive. To delete the entire object, use p_ccl_free(). @@ -3641,7 +3645,7 @@
-Returns a new character-class containing the insersections from ccl +Returns a new character-class containing the intersection of ccl and within. If there is no intersection between both character-classes, the function returns (pccl*)NULL. @@ -3691,7 +3695,7 @@
Parses the character-class definition provided in ccldef and assigns this definition to the character-class ccl. ccldef may contain -UTF-8 formatted input. Escape-sequences will be interpretered to their correct +UTF-8 formatted input. Escape-sequences will be interpreted to their correct character representations.
@@ -3726,7 +3730,7 @@
-Reads a character from a string. The character may exist of one single +Reads a character from a string. The character may consist of one single character or it may be made up of an escape sequence or UTF-8 character. The function returns the number of bytes read.
@@ -3766,7 +3770,7 @@-If no shorthand sequence could be found, it returns FALSE, remaining ccl +If no shorthand sequence could be found, it returns FALSE, leaving ccl untouched. @@ -3855,7 +3859,7 @@
-Tests a character-class if it cointains a character. +Tests a character-class if it contains a character.
ccl is the pointer to character-class to be tested. @@ -3928,7 +3932,7 @@
-Unions two character-classes into a new, normalized one. +Creates the union of two character-classes and returns the newly created, +normalized character-class.
ccl is the pointer to the character-class that will be extended to all -ranges contained in add. -add is character-class that will be unioned with ccl. +ranges contained in add. add is the character-class that will be joined +with ccl.
The function creates and returns a new character-class that is the union -if ccl and add. +of ccl and add.
-Print the type and value of val to stream -without any conversion. This function shall be used for debug only. +Print the type and value of val to stream without any conversion. +This function shall be used for debugging purposes only.
stream is the stream to write to. @@ -4491,7 +4496,7 @@
Any other content is taken as string. If the parameter enforce is set to -an desired PANY_-type, this type will be enforced, and no special recognition +a desired PANY_-type, this type will be enforced, and no special recognition is done.
@@ -5285,10 +5290,10 @@
-chunk defines the chunk size, where an array-(re)allocation will be performed. -If, e.g. this is set to 128, then, if the 128th item is created within the -array, a realloction is done. Once allocated memory remains until the array is -freed again. +chunk defines the chunk size, when an array-(re)allocation will be +performed. If, e.g. this is set to 128, then, if the 128th item is created +within the array, a realloction is done. Once allocated memory remains until +the array is freed again.
The function returns the pointer of the popped item. Because dynamic arrays only grow and no memory is freed, the returned data pointer is still valid, and will -only be overidden with the next push operation. +only be overridden with the next push operation.
array is the pointer to array where to pop an item off. @@ -5660,7 +5665,7 @@
-Use parray_get() for access items from the begin. +Use parray_get() to access items from the begin.
The function returns the pointer of the shifted item. Because dynamic arrays only grow and no memory is freed, the returned data -pointer is still valid, and will only be overidden with the next unshift +pointer is still valid, and will only be overridden with the next unshift operation.
@@ -5828,7 +5833,7 @@
-The function returns the address of the newly unhshifted item, and (void*)NULL +The function returns the address of the newly unshifted item, and (void*)NULL if the item could not be unshifted.
-Returns a char* Returns the allocated string which cointains the format string +Returns a char* Returns the allocated string which contains the format string with inserted values. @@ -6025,7 +6030,7 @@
-It could be used this way to immedatelly reset a pointer to NULL: +It could be used this way to immediately reset a pointer to NULL:
@@ -6036,7 +6041,7 @@ pfree
ptr is the pointer to be freed.
-Returns always (void*)NULL.
+Always returns (void*)NULL.
@@ -6178,7 +6183,7 @@ plex_create
PREGEX_COMP_STATIC
-The regular expressions passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped.
+The regular expressions passed should be converted 1:1 as if it were a string-constant. Any regex-specific symbols will be ignored and taken as if escaped.
PREGEX_RUN_WCHAR
@@ -6198,7 +6203,7 @@ plex_create
PREGEX_RUN_DEBUG
-Debug mode; output some debug to stderr.
+Debug mode; output some debug info to stderr.
@@ -6271,7 +6276,7 @@ plex_define
PREGEX_COMP_STATIC
-The regular expressions passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped.
+The regular expressions passed should be converted 1:1 as if it were a string-constant. Any regex-specific symbols will be ignored and taken as if escaped.
PREGEX_COMP_PTN
@@ -6308,7 +6313,7 @@ plex_free
lex is the pointer to a plex-structure that will be released.
-Returns always (plex*)NULL.
+Always returns (plex*)NULL.
@@ -6366,7 +6371,7 @@ plex_next
If a token can be matched, the function returns the pointer to the position
-where the match starts at. id receives the id of the matching patternn,
+where the match starts at. id receives the id of the matching pattern,
end receives the end pointer of the match, when provided. id and end
can be omitted by providing NULL-pointers.
@@ -6485,7 +6490,7 @@ plist_clear
The function has nearly the same purpose as plist_erase(), except that
the entire list is only cleared, but if the list was initialized with
-PLIST_MOD_RECYCLE, existing pointers are hold for later usage.
+PLIST_MOD_RECYCLE, existing pointers are held for later usage.
@@ -6566,19 +6571,19 @@ plist_create
- PLIST_MOD_NONE for no special flagging.
-- PLIST_MOD_PTR to use the plist-object in pointer-mode: Each plistel-element cointains only a pointer to an object in the memory and returnsthis, instead of copying from or into pointers.
+
- PLIST_MOD_PTR to use the plist-object in pointer-mode: Each plistel-element cointains only a pointer to an object in the memory and returns this, instead of copying from or into pointers.
-- PLIST_MOD_RECYCLE to configure that elements that are removed during listusage will be reused later.
+
- PLIST_MOD_RECYCLE to configure that elements that are removed during list usage will be reused later.
- PLIST_MOD_AUTOSORT to automatically sort elements on insert operations.
-- PLIST_MOD_EXTKEYS to configure that string pointers to hash-table keyvalues are stored elsewhere, so the plist-module only uses the originalpointers instead of copying them.
+
- PLIST_MOD_EXTKEYS to configure that string pointers to hash-table keyvalues are stored elsewhere, so the plist-module only uses the original pointers instead of copying them.
-- PLIST_MOD_PTRKEYS disables string keys and uses the pointer/valueprovided as key directly.
+
- PLIST_MOD_PTRKEYS disables string keys and uses the pointer/value provided as key directly.
-- PLIST_MOD_UNIQUE to disallow hash-table-key collisions, so elements witha key that already exist in the object will be rejected.
+
- PLIST_MOD_UNIQUE to disallow hash-table-key collisions, so elements with a key that already exist in the object will be rejected.
-- PLIST_MOD_WCHAR to let all key values handle as wide-character strings.
+
- PLIST_MOD_WCHAR to handle all key values as wide-character strings.
@@ -6834,7 +6839,7 @@ plist_init
flags defines an optional flag configuration that modifies the behavior
of the linked list and hash table usage.
-
+
@@ -6859,8 +6864,7 @@ plist_insert
list.
-If key is not NULL, the element will be additionally engaged
-into the lists hash table.
+If key is not NULL, the element will also be added to the lists hash table.
If src is NULL, a zero-initialized element is inserted into the list for
@@ -7041,7 +7045,7 @@
plist_pop
Pop last element to dest off the list list.
-Like list would be a stack, the last element of the list is poppend and
+Like list would be a stack, the last element of the list is popped and
its content is written to dest, if provided at the end of the list.
@@ -7066,7 +7070,7 @@
plist_prev
Usage:
-Access previous element of a current unit u.
+Access previous element of current unit u.
@@ -7111,7 +7115,7 @@ plist_remove
Usage:
-Removes the element e from the the list and frees it or puts
+Removes the element e from the list and frees it or puts
it into the unused element chain if PLIST_MOD_RECYCLE is flagged.
@@ -7293,7 +7297,7 @@ plist_shift
Shift src at begin of list.
-Like list would be a queue, src is shifted at the begin of the list.
+Like list would be a queue, src is shifted at the beginning of the list.
This function can only be used for linked lists without the hash-table feature
in use.
@@ -7317,7 +7321,7 @@
plist_size
Return element size of list l.
-
+
@@ -7342,10 +7346,12 @@ plist_sort
The sort-function can be modified by using plist_set_sortfn().
-The default sort function sorts the list by they contents, internally by using
-the memcmp() standard function.
+
+
+The default sort function sorts the list by content using the memcmp()
+standard function.
-
+
@@ -7371,8 +7377,10 @@ plist_subsort
The sort-function can be modified by using plist_set_sortfn().
-The default sort function sorts the list by they contents, internally by using
-the memcmp() standard function.
+
+
+The default sort function sorts the list by content using the memcmp()
+standard function.
@@ -7392,9 +7400,9 @@ plist_swap
Usage:
-Swaps the positions of the list elemements a and b with each
+Swaps the positions of the list elements a and b with each
other. The elements must be in the same plist object, else the function
-returns with FALSE.
+returns FALSE.
@@ -7444,15 +7452,15 @@ plist_unshift
Usage:
-Take first element to dest from the list list.
+Take first element of list and write it to dest.
Like list would be a queue, the first element of the list is taken and
its content is written to dest.
-dest can be omitted and given as (void*)NULL, so the first element will
-be taken from the list and discards.
+dest can be omitted and given as (void*)NULL, so the first element from
+list will be taken and discarded.
@@ -7476,7 +7484,7 @@ pmalloc
The function is a wrapper for the system function malloc(), but with memory
-initialization to zero, and immediatelly stops the program if no more memory
+initialization to zero, and immediately stops the program if no more memory
can be allocated.
@@ -7511,7 +7519,7 @@
pmemdup
size is the size of pointer's data storage.
-Returns the new pointer to the memory copy. This should be casted back to the
+Returns the new pointer to the memory copy. This should be cast back to the
type of ptr again.
@@ -7794,11 +7802,11 @@ pp_gram_from_bnf
Usage:
-Compiles a Backus-Naur-Format definition into a grammar.
+Compiles a Backus-Naur form definition into a grammar.
g is the grammar that receives the result of the parse.
-This grammar is extended to new definitions when it already contains symbols.
+This grammar gets extended with new definitions if it already contains symbols.
src is the BNF definition string that defines the grammar.
@@ -7841,7 +7849,7 @@
pp_gram_from_ebnf
Usage:
-Compiles an Extended Backus-Naur-Format definition into a grammar.
+Compiles an Extended Backus-Naur form definition into a grammar.
g is the grammar that receives the result of the parse.
@@ -7872,7 +7880,7 @@
pp_gram_from_ebnf
-
+
pp_gram_from_pbnf
@@ -7889,7 +7897,7 @@ pp_gram_from_pbnf
Usage:
-Compiles an Phorward Backus-Naur-Format definition into a parser.
+Compiles an Phorward Backus-Naur form definition into a parser.
p is the parser that receives the result of the parse.
@@ -7929,13 +7937,12 @@
pp_gram_from_pbnf
// Nonterminals ----------------------------------------------------------------
-inline := Flag_emit '(' alternation ')'
- | '(' alternation ')'
- ;
-
terminal : CCL | String | Token | Regex | Function ;
-symbol := Terminal | Nonterminal | terminal | inline ;
+symbol := Terminal
+ | Nonterminal
+ | terminal
+ | '(' alternation ')' = inline ;
modifier : symbol '*' = kle
| symbol '+' = pos
@@ -7994,7 +8001,7 @@ pp_gram_prepare
-- Setting up final symbol and productions IDs
+
- Setting up final symbol and production IDs
- Nonterminals FIRST-set computation
@@ -8090,7 +8097,7 @@ pp_par_create
Usage:
-Creates a new parser object with the underlying grammar g.
+Creates a new parser object using the underlying grammar g.
The grammar must either be parsed first via one of the BNF parsers
@@ -8099,7 +8106,7 @@
pp_par_create
The provided grammar gets "frozen" when a parser is created from it.
-Modifications on the grammar with a parser based on an older grammar state may
+Modification of the grammar with a parser based on an older grammar state may
cause memory corruption and crashes.
@@ -8169,13 +8176,13 @@
pp_par_parse
Usage:
-Run parser p with input start.
+Run parser par with input start.
-Currently, the used parsing method is only LALR(1).
+Currently, the used parsing method is LALR(1).
-It returns an abstract syntax tree to root on success.
+It returns an abstract syntax tree in root on success.
@@ -8299,7 +8306,7 @@ pp_prod_remove
Usage:
-Removes all occurences of symbol sym from the right-hand-side of
+Removes all occurrences of symbol sym from the right-hand-side of
production p.
@@ -8628,9 +8635,9 @@ prealloc
Dynamically (re)allocate memory on the heap.
-The function is a wrapper to the system-function realloc(), but always
-accepts a NULL-pointer and immediatelly stops the program if no more memory
-can be allocated.
+The function wraps the system-function realloc(), but always accepts a
+NULL-pointer and immediately stops the program if no more memory can be
+allocated.
oldptr is the pointer to be reallocated. If this is (void*)NULL, prealloc() works like a normal call to pmalloc().
@@ -8640,7 +8647,7 @@
prealloc
The function returns the allocated heap memory pointer. The returned memory
-address should be freed using pfree() after it is not required anymore.
+address should be freed using pfree() after it is not required any more.
@@ -8698,7 +8705,7 @@ pregex_create
PREGEX_COMP_STATIC
-The regular expression passed should be converted 1:1 asit where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped.
+The regular expression passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped.
PREGEX_RUN_WCHAR
@@ -8864,7 +8871,7 @@ pregex_qmatch
regex is the regular expression pattern to be processed.
-str is the string on which the pattern will be executed on.
+str is the string on which the pattern will be executed.
flags are for regular expression compile- and runtime-mode switching.
@@ -8876,8 +8883,8 @@
pregex_qmatch
It is optional. matches must be released with parray_free() after its usage.
-Returns the number of matches, which is the amount of result entries in the
-returned array matches. If the value is negative, an error occured.
+Returns the number of matches, which is the number of result entries in the
+returned array matches. If the value is negative, an error occurred.
@@ -8905,7 +8912,7 @@ pregex_qreplace
regex is the regular expression pattern to be processed.
-str is the string on which the pattern will be executed on.
+str is the string on which the pattern will be executed.
replace is the string that will be inserted as replacement for each pattern
@@ -8945,7 +8952,7 @@
pregex_qsplit
regex is the regular expression pattern to be processed.
-str is the string on which the pattern will be executed on.
+str is the string on which the pattern will be executed.
flags are for regular expression compile- and runtime-mode switching.
@@ -8957,7 +8964,7 @@
pregex_qsplit
It is optional. matches must be released with parray_free() after its usage.
-Returns the number of split substrings, which is the amount of result entries in
+Returns the number of split substrings, which is the number of result entries in
the returned array matches. If the value is negative, an error occured.
@@ -8992,7 +8999,7 @@ pregex_replace
The function returns the string with the replaced elements, or (char*)NULL
-in error case.
+in case of an error.
@@ -9027,8 +9034,8 @@ pregex_split
called in a loop.
-The function returns (char*)NULL in case that there is no more string to split,
-else it returns start.
+The function returns (char*)NULL in case there is no more string to split, else
+it returns start.
@@ -9049,7 +9056,7 @@ pregex_splitall
Split a string at all matches of the regular expression regex from
-begin of pointer start, and optionally return the splitted matches as an
+begin of pointer start, and optionally returns the substrings found as an
array.
@@ -9060,7 +9067,7 @@
pregex_splitall
The function fills the array matches, if provided, with items of size
prange. It returns the total number of matches.
-
+
@@ -9078,19 +9085,18 @@ pstr_to_wcs
Usage:
-This functions converts an UTF-8-multi-byte string into an Unicode
+This functions converts an UTF-8-multi-byte string into a Unicode
wide-character string.
-The string conversion is performed into dynamically allocated memory.
The function wraps mbstowcs(), so set_locale() must be done before this
function works properly.
str is the zero-terminated multi-byte-character string to be converted
into a wide-character string.
-freestr defines if the input-string shall be freed after successfull
-conversion, if set to TRUE.
+freestr if value equals TRUE then str will be freed after successfull
+conversion.
Returns the wide-character pendant of str as pointer to dynamically
@@ -9114,7 +9120,7 @@
pstrcasecmp
Usage:
-Compare a string by ignoring case-order.
+Compare a string ignoring case-order.
s1 is the string to compare with s2.
@@ -9146,7 +9152,7 @@
pstrcatchar
str is the pointer to a string to be appended. If this is (char*)NULL,
-the string will be newly allocated. chr is the the character to be appended
+the string will be newly allocated. chr is the character to be appended
to str.
@@ -9183,12 +9189,12 @@
pstrcatstr
freesrc frees the pointer provided as append automatically by
-this function, if set to TRUE. This parameter has only a comfort-function.
+this function, if set to TRUE.
Returns a char*-pointer to (possibly re-)allocated and appended string.
(char*)NULL is returned if no memory could be (re)allocated, or both strings
-where NULL. If dest is NULL and freesrc is FALSE, the function
+were NULL. If dest is NULL and freesrc is FALSE, the function
automatically returns the pointer src. This pointer must be released with pfree() when its existence is no longer required.
@@ -9237,10 +9243,10 @@ pstrget
Usage:
-Savely reads a string.
+Safely reads a string.
-str is the string pointer to be savely read. If str is NULL, the
+str is the string pointer to be safely read. If str is NULL, the
function returns a pointer to a static address holding an empty string.
@@ -9265,7 +9271,7 @@
pstrlen
str is the parameter string to be evaluated. If (char*)NULL, the function
-returns 0. pstrlen() is much more saver than strlen() because it returns 0 when
+returns 0. pstrlen() is much safer than strlen() because it returns 0 when
a NULL-pointer is provided.
@@ -9315,7 +9321,7 @@
pstrlwr
Usage:
-Convert a string to lower-case order.
+Convert a string to lower-case.
s is the acts both as input and output-string.
@@ -9341,7 +9347,7 @@
pstrncasecmp
Usage:
-Compare a string by ignoring case-order about a maximum of n bytes.
+Compare two strings ignoring case-order up to a maximum of n bytes.
s1 is the string to compare with s2.
@@ -9349,10 +9355,10 @@
pstrncasecmp
n is the number of bytes to compare.
-Returns 0 if both strings are equal. Returns a value <0 if s1 is lower than
+Returns 0 if both strings are equal. Returns a value <0 if s1 is less than
s2 or a value >0 if s1 is greater than s2.
-
+
@@ -9370,8 +9376,7 @@ pstrncatstr
Usage:
-Dynamicaly appends a number of n-characters from one string to another
-string.
+Dynamicaly appends n-characters from one string to another string.
The function works similar to pstrcatstr(), but allows to copy only a maximum
@@ -9385,7 +9390,7 @@
pstrncatstr
Returns a char*-pointer to (possibly re-)allocated and appended string.
(char*)NULL is returned if no memory could be (re)allocated, or both strings
-where NULL. This pointer must be released with pfree() when its existence
+were NULL. This pointer must be released with pfree() when its existence
is no longer required.
@@ -9415,7 +9420,7 @@ pstrndup
str is the parameter string to be duplicated. If this is provided as
(char*)NULL, the function will also return (char*)NULL.
-n is the the number of characters to be copied and duplicated from str.
+n is the number of characters to be copied and duplicated from str.
If n is greater than the length of str, copying will stop at the zero
terminator.
@@ -9442,8 +9447,8 @@ pstrput
Usage:
-Assign a string into a dynamically allocated pointer.
- pstrput() manages the assignment of an dynamically allocated string.
+Assign a string to a dynamically allocated pointer.
+ pstrput() manages the assignment of a dynamically allocated string.
str is a pointer receiving the target pointer to be (re)allocated. If
@@ -9451,11 +9456,11 @@
pstrput
to a copy of val.
-val is the the string to be assigned to str (as a independent copy).
+val is the string to be assigned to str (as a independent copy).
Returns a pointer to the allocated heap memory on success, (char*)NULL else.
-This is the same pointer as returned like calling *str
. The returned pointer
+This is the same pointer as returned when calling *str
. The returned pointer
must be released with pfree() or another call of pstrput(). Calling pstrput()
as pstrput( &p, (char*)NULL );
is equivalent to p = pfree( &p )
.
@@ -9502,11 +9507,11 @@
pstrrender
-Returns an allocated string which is the resulting source. This string must be
-release by pfree() or another function releasing heap memory when its existence
-is no longer required.
+Returns an allocated string which is the result of rendering. This string must
+be released by pfree() or another function releasing heap memory when its
+existence is no longer required.
-
+
@@ -9528,13 +9533,16 @@ pstrreplace
str is the string to be replaced in. find is the substring to be
-matched. replace is the the string to be inserted for each match of the
+matched. replace is the string to be inserted for each match of the
substring find.
-Returns a pointer to char* containing the allocated string which is the
-resulting source. This pointer must be released with pfree() when its existence
-is no longer required.
+Returns a char* containing the allocated string which is the result of replacing
+all occurences of find with replace in str.
+
+
+This pointer must be released with pfree() when its existence is no longer
+required.
@@ -9584,12 +9592,12 @@ pstrsplit
token reference pointers.
-tokens is the an allocated array of tokenized array values.
+tokens is an allocated array of tokenized array values.
Requires a pointer to char**.
str is the input string to be tokenized.
sep is the token separation substring.
-limit is the token limit; If set to 0, there is no token limit available, so
-that as much as possible tokens are read.
+limit is the token limit; If set to 0, there is no token limit available,
+in which case as many as possible tokens are read.
Returns the number of separated tokens, or -1 on error.
@@ -9685,8 +9693,8 @@
pstrunescape
The replacement is done within the memory bounds of str itself, because the
-unescaped version of the character requires lesser space that its previous
-escape sequence.
+unescaped version of the character requires less space than its previous escape
+sequence.
The function always returns its input pointer.
@@ -9722,10 +9730,10 @@
pstrupr
Usage:
-Convert a string to upper-case order.
+Convert a string to upper-case.
-s is the acts both as input and output-string.
+s acts both as input- and output string.
Returns s.
@@ -9751,12 +9759,12 @@
pvasprintf
Implementation and replacement for vasprintf.
-str is the pointer receiving the resultung, allocated string pointer.
-fmt is the the format string.
+str is the pointer receiving the result, allocated string pointer.
+fmt is the format string.
... are the parameters according to the placeholders set in fmt.
-Returns the number of characters written, or -1 in error case.
+Returns the number of characters written, or -1 in case of an error.
@@ -9908,7 +9916,7 @@ pwcs_to_str
str is the zero-terminated string to be converted to UTF-8.
-freestr defines if the input-string shall be freed after successfull
+freestr defines if the input-string shall be freed after successful
conversion, if set to TRUE.
@@ -9968,13 +9976,13 @@
pwcscatstr
str is the pointer to a wchar_t-string to be appended. If this is
(wchar_t*)NULL, the string is newly allocated.
-append is the the string to be appended.
+append is the string to be appended.
freesrc if true, append is free'd automatically by this function.
Returns a wchar_t* Pointer to (possibly re-)allo- cated and appended string.
(wchar_t*)NULL is returned if no memory could be (re)allocated, or both strings
-where NULL.
+were NULL.
@@ -10022,10 +10030,10 @@ pwcsget
Usage:
-Savely reads a wide-character string.
+Safely reads a wide-character string.
-str is the string pointer to be savely read. If str is NULL, the
+str is the string pointer to be safely read. If str is NULL, the
function returns a pointer to a static address holding an empty string.
@@ -10046,13 +10054,13 @@ pwcslen
Usage:
-Saver strlen replacement for wide-character.
+Safe strlen replacement for wide-character.
str is the parameter string to be evaluated. If (wchar_t*)NULL,
the function returns 0.
-
+
@@ -10070,19 +10078,18 @@ pwcsncatstr
Usage:
-Appends a number of N characters from one wide-character string to a dynamic
-string.
+Appends n characters from one wide-character string to a dynamic string.
str is the pointer to a wchar_t-string to be appended. If this is
(wchar_t*)NULL, the string is newly allocated.
append is the begin of character sequence to be appended.
-n is the amount of characters to be appended to str.
+n is the number of characters to be appended to str.
Returns a wchar_t* Pointer to (possibly re-)allo- cated and appended string.
(wchar_t*)NULL is returned if no memory could be (re)allocated, or both strings
-where NULL.
+were NULL.
@@ -10141,7 +10148,7 @@ pwcsput
Usage:
-Assign a wide-character string into a dynamically allocated pointer.
+Assign a wide-character string to a dynamically allocated pointer.
pwcsput() manages the assignment of an dynamically allocated wide-chararacter
string.
@@ -10152,15 +10159,15 @@ pwcsput
val is the the wide-character string to be assigned to str
-(as a independent copy).
+(as an independent copy).
Returns a pointer to the allocated heap memory on success, (char_t*)NULL else.
-This is the same pointer as returned like calling *str
. The returned pointer
+This is the same pointer as returned when calling *str
. The returned pointer
must be released with pfree() or another call of pwcsput(). Calling pwcsput()
as pwcsput( &p, (char*)NULL );
is equivalent to p = pfree( &p )
.
-
+
@@ -10186,8 +10193,9 @@ pwhich
directories is a string specifying the directories to search in.
If this is (char*)NULL, the environment variable PATH will be used and
-evaluated by using getenv(). The path can be split with multiple pathes
-by a character that depends on the current platform (Unix: ":", Windows: ";").
+evaluated by using getenv() #fn_getenv]. The path can be split with multiple
+paths by a character that depends on the current platform
+(Unix: ":", Windows: ";").
Returns a static pointer to the absolute path that contains the file specified
@@ -10293,10 +10301,10 @@
u8_parse_char
chr is the input- and output-pointer (the pointer is replaced by the pointer
-to the next character or escape-sequence within the string.
+to the next character or escape-sequence within the string).
-The function teturns the character code of the parsed character.
+The function returns the character code of the parsed character.
diff --git a/doc/phorward.t2t b/doc/phorward.t2t
index f23a4bef..aea931fa 100644
--- a/doc/phorward.t2t
+++ b/doc/phorward.t2t
@@ -1,6 +1,6 @@
The Phorward Libraries
-libphorward 0.22.1
-April 2018
+libphorward 0.22.3
+May 2018
%!preproc(xhtml): '@([a-zA-Z0-9_]+)((\(\))?)' '[\1\2 #fn_\1]'
%!preproc(xhtml): '%NEED:(\d+)' "''' "
@@ -30,7 +30,7 @@ The library is made up of several modules. These are:
- **any** provides a dynamical, extendible data structure and interface to store, convert and handle variables of different value types ("variant" data type),
- **base** provides tools for dynamic data structures and utility functions used throughout the library, including linked lists, hash-tables, stacks and arrays,
-- **parse** defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from *regex* for lexical analysis,
+- **parse** defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from //regex// for lexical analysis,
- **regex** provides tools for lexical analysis and regular expression processing,
- **string** is an extended string processing library,
- **vm** can be used to implement and run stack-based virtual machines and instruction sets aimed to work with the *any* data type.
diff --git a/doc/ref.t2t b/doc/ref.t2t
index a85308d9..fe9801a6 100644
--- a/doc/ref.t2t
+++ b/doc/ref.t2t
@@ -341,8 +341,8 @@ pboolean p_ccl_compat( pccl* l, pccl* r )
**Usage:**
-Checks if the character-classes //l// and //r// are in the same
-character universe and compatible for operations.
+Checks if the character-classes //l// and //r// are configured
+to be in the same character universe and compatible for operations.
%FUNCTION:END
%NEED:15
%FUNCTION:BEGIN
@@ -362,7 +362,7 @@ Returns the number of characters within a character-class.
Returns the total number of characters the class is holding.
%FUNCTION:END
-%NEED:15
+%NEED:17
%FUNCTION:BEGIN
=== p_ccl_create ===[fn_p_ccl_create]
@@ -376,6 +376,8 @@ pccl* p_ccl_create( int min, int max, char* ccldef )
Constructor function to create a new character-class.
+//min// and //max// can either be specified as -1, so the configured default
+constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted.
Returns a pointer to the newly created character-class. This pointer should be
released with [p_ccl_free() #fn_p_ccl_free] when its existence is no longer required.
diff --git a/src/Makefile.in b/src/Makefile.in
index 96fe9076..a099dd3c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -941,7 +941,8 @@ any/any.print.c: any/any.h any/any.gen.awk
# Phorward Foundation Library Documentation
../doc/ref.t2t: $(libphorward_la_SOURCES) $(noinst_HEADERS)
- echo "" >$@
+ echo "% --- DON'T EDIT THIS FILE, IT IS GENERATED FROM SRC/ ---" >$@
+ echo "" >>$@
echo "" >>$@
echo "" >>$@
pdoc -d 2 $(libphorward_la_SOURCES) $(noinst_HEADERS) >>$@
diff --git a/src/base/ccl.c b/src/base/ccl.c
index dc45126a..901cd52a 100644
--- a/src/base/ccl.c
+++ b/src/base/ccl.c
@@ -23,6 +23,8 @@ static int ccl_SORTFUNC( plist* list, plistel* el, plistel* er )
/** Constructor function to create a new character-class.
+//min// and //max// can either be specified as -1, so the configured default
+constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted.
Returns a pointer to the newly created character-class. This pointer should be
released with p_ccl_free() when its existence is no longer required.
@@ -64,8 +66,8 @@ pccl* p_ccl_create( int min, int max, char* ccldef )
RETURN( ccl );
}
-/** Checks if the character-classes //l// and //r// are in the same
-character universe and compatible for operations. */
+/** Checks if the character-classes //l// and //r// are configured
+to be in the same character universe and compatible for operations. */
pboolean p_ccl_compat( pccl* l, pccl* r )
{
if( !( l && r ) )
diff --git a/src/phorward.h b/src/phorward.h
index 835ac9e6..55ebacae 100644
--- a/src/phorward.h
+++ b/src/phorward.h
@@ -99,7 +99,7 @@ typedef char pboolean;
-#define LIBPHORWARD_VERSION "0.22.2"
+#define LIBPHORWARD_VERSION "0.22.3"
diff --git a/src/version.h b/src/version.h
index 6138eb9c..d8c345e9 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define LIBPHORWARD_VERSION "0.22.2"
+#define LIBPHORWARD_VERSION "0.22.3"