parser



news

[February 24, 2011]  Version 3.4.1 released.

Now Parser3 has native JSON support.

Now Parser3 is able to load files from external HTTP/HTTPS servers using libcurl library.

Now Parser3 tries to search files loaded in @USE/^use[] relatively from the file where these @USE/^use[] are written.

Now user defined methods can handle variable number of parameters: @method[arg;*args] (a hash with numeric keys will be in a variable $args.

Acceptable call types now can be defined for user methods. In meta-command @OPTIONS parameter dynamic or static can be specified (default — any), which will influence to all methods of the file. Particular methods can be declared as statical: @static:method[params].

A special default setter (@SET_DEFAULT[name;value]) can be defined in user classes. This setter will be called during writing to unknown fields of the class/object.

Operator if now can have several «elseif» sections, for example: ^if(a>0){1}(a==0){0}{-1}.

User defined classes do not inherit method @auto[] any longer.

Class void now has all methods available for class string. This means that strings' methods can be called for undefined variable as well.

Class hash now has a new method ^hash._at($index) (or ^hash._at[first|last]) that can be used for accessing element by its index (hashes' elements are ordered since version 3.4.0).

Operator ^apply-taint[[transformation-type]][...] was added. This operator applies inplace transformation to all tainted parts of the string. Parts within undefined transformation type will be processed using specified transformation type (as-is by default).

Method for converting numbers from one base to another was added.

Method ^table.select(...)[options] now supports options $.limit(X) and $.reverse(true|false).

Method ^string.match[...] now can supports four parameters. The value of fourth parameter is returned if nothing was found in the string.

Unknown ^string.match[...] options now cause an exception.

Method ^string:js-unescape[...] now also decodes \uXXXX-encoded symbols.

Constructor ^file::base64[encoded] now also supports another format: ^file::base64[text|binary;file-name;enoded[;$.content-type[...]]].

An option $.content-type[...] now can be specified during creation of file's object.

Method ^reflection:copy[$src;$dest] was added.

Options $.encloser[#] and $.separator[#] now switch the automatics comments removing off while loading table or file.

Parser3 now ignores white-space characters that are written between methods' definitions.

Parser3 now ignores trailing white-space characters in @META commands (@USE, @CLASS, @BASE, @OPTIONS) and their values.

Unsafe Parser3 version do not have restrictions to environment variable names passed to executed scripts any longer.

The third option of method ^image.replace(color-from;color-to)[poligon] is not compulsory any longer. If not specified the color will be replaced in whole image.

A text file, which is loaded without $.charset option specified, that contains a BOM code, will be transcoded from UTF-8 to $request:charset automatically.

In a field $.inherited method ^reflection:method_info[class-name;method-name] now returns the name of class where the method is actually defined.

In a field $.overridden method ^reflection:method_info[class-name;method-name] now returns the name of ancestor's class where the overridden method is defined.

In a field $.file method ^reflection:method_info[class-name;method-name] now returns the full file specification where the method is defined.

Using $request:post-body now it is possible to get POST-request body as a file.

Latest versions of libraries are included: PCRE (8.12) and libxml2 (2.7.8).

A number of bugs were fixed.



[July 08, 2009]  Version 3.4.0 released.

Now Parser3 can be compiled as 64-bit executable. However, keep in mind that it will use more memory than 32-bit version.

Many optimizations were done. Now Parser3 uses much less memory and executes faster.

Method @GET[] now can be defined with a parameter. Context type is passed in this parameter, so the method's code might distinguish calls in different contexts.

Classes can not be derived from system classes any longer.

Now regular expressions are studied after the compilation. In some cases it makes search faster.

New class regex was added. You can reuse once created regex-pattern and use it many times.

New class reflection was added. Using this class it is possible to get detailed information about classes and their methods.

Now constructor ^file::load[mode;http://server/] is able to send files to the remote HTTP servers.

Now hash knows the order of its elements. Methods ^hash.foreach[...]{...} and ^hash._keys[...] process the elements in this order.

Now the normalization of EOLs is occured after base64-decoding data into a string.

Now ^taint[js][...] converts characters with code \x0D to "\r".

New taint-transformation parser-code was added.

Now the body of operator process is subject to untaint-transformation with parser-code type. This means that Parser3 code that came from untrusted sources (file, DB, cookies, form, etc) will not be executed any longer. To fix it you have to replace ^process{...} with ^process{^untaint[as-is]{...}}.

Constructor ^file::create[...] now can accept three parameters. In the third parameter an option $.charset[encoding] can be specified for creating file in the required encoding.

Objects of class file now have a new field mode.

Rows of nameless tables now are available as a hash.

The third parameter of method ^image.font[...] is not mandatory any longer. If not specified, the space width will be equal to image width. Also, now it can be specified as a hash with options $.space(space width), $.width(character witch), $.spacing(distance between characters).

Now constructors are also inherited from ancestors so they should not be defined right into class as before.

Access to undefined class now triggers the execution of @autouse[name]. In the operator's body the lazy class loading can be implemented.

Now it is possible to define the encoding during saving of file or string.

Now HTTP and mail headers are capitalized.

Now Parser3 escapes international characters in sending emails using base64 instead of uue (you still able to use option $.format[uue] to use uue escape method).

Now base64 and uue encoding use less memory.

Now ^rem{...} operator is removed during compilation instead of dummy-execution.

Latest versions of libraries are included: GC (7.1), PCRE (7.9), libxml2 (2.7.6) and libxslt (1.1.26).

Plenty of bugs were fixed.



[September 04, 2008]  Version 3.3.0 released.

Parser3 now encodes cookies in a different way (%uXXXX instead of %XX). This allows to work with cookies encoded by Parser3 on client-side using JavaScript.

User defined classes now can have method @GET[] which is executed during accessing the object in scalar context: ^if($oMyObject){...}.

User defined classes now can have default getter (@GET_DEFAULT[name]) – a special getter which is executed during reading unknown classes fields.

Additional methods can also be added to an existing class using a new meta-command @OPTIONS with a value partial.

All variables in a file can be declared as locals using a new meta-command @OPTIONS with a value locals.

All method's variables can be declared as locals using just one keyword locals instead of listing all of them.

Several classes now can be defined in one file.

Constructor ^hash::sql{...} now accepts a new option $.type[hash|table|string] with the same meaning as the same option of method ^table.hash[...].

Objects of class file which were loaded locally have fields $.adate, $.mdate and $.cdate straight away.

Now try operator has finally section.

Now the encoding of incoming POST requests can be gotten from $request:post-charset. This encoding is used for transcoding incoming request from instead of $response:charset.

New methods to convert IP address to int and vice-versa were added.

Constructor ^file::sql{...} now accepts options $.limit and $.offset.

New constructor ^date::create[date-object] was added.

Method ^str.pos[substr] now can also accept the beginning search position as a second parameter.

The body ot case statement now can be specified as an expression.

Symbols @ and # now can be added at the beginning of lines using the common Parser3 escaping sybmol ^.

New methods ^str.js-escape[] and ^string:js-unescape[encoded] were added. They are equivalent to JavaScript functions escape and unescape.

A new version of PCRE library brings plenty of features including named sub-patterns, recursions and many others.

Parser3 now knows more EXIF tags (including GPS-related).

Option $.limit(0) in SQL queries is not ignored any longer.

SQL drivers were updated. The new version of Parser3 is not working with the old drivers.

Format of ODBC driver's options has changed. Now it is the similar to other drivers formats.

SQLite, ODBC and PostgreSQL drivers now accept option autocommit=0.

Oracle's driver now uses Oracle's specific and modifies SQL queries. In some cases you would like to disable this behaviour using new options DisableQueryModification=1.

ODBC driver now accepts new option SQL=MSSQL|Pervasive|FireBird. It can be usable for forcing the driver to speedup queries execution by modifying them in a specified manner.

Path to DB file for SQLite driver now should be specified related to document-root.

SQL drivers were optimized and the changes is especially notable in Oracle and ODBC drivers.

Methods of class string, such as ^str.length[], ^str.left(len), ^str.right(len), ^str.mid(from;len), ^str.pos[substr] and ^str.match[...] now work with strings in UTF-8 encoding correctly.

Some bugs were fixed.

Latest versions of libraries are included: PCRE (7.7), libxml2 (2.6.32) and libxslt (1.1.24).



[April 10, 2008]  Version 3.2.3 released.

Bugs which were introduced in version 3.2.2 were fixed.

Latest versions of xml/xslt libraries included.

Few new methods added: ^hash.contains[], ^date:last-day(year;month), ^date.last-day[], ^date.gmt-string[].



[December 27, 2007]  Version 3.2.2 released.

Lots of bug fixes and new features: check out documentation, look for [3.2.2] version-marks.

In short:

Driver for SQLite was released (thanks to Niko and Creator).

Locks on unix were fixed.

Latest versions of xml/xslt libraries included.

Many new file methods added like: copy, md5, base64, crc32.

And many others improvements and bug fixes.



[March 17, 2006]  Versions 3.1.6sp2 and 3.2.1sp2 released

Error with $.encloser[] in table.save was fixed;

Security issue in mail:send was fixed;

^string:base64[encoded] didn't work in version 3.2.1.



[December 29, 2005]  Version 3.2.1 released:

Completely rewritten DOM inteface with XML, now Parser does that without gdome library (and glib too);

Compiling Parser (with XML!) from source code on Unix became trivial. Now one can download/unpack Parser source code and run one shell script. See INSTALL for details.

Some compiler error messages (in hard cases) made clearer.



[December 29, 2005]  Version 3.1.6 released:

Fixed long-hiding error which occured when working with XML via DOM properties/methods.



[December 08, 2005]  Version 3.2.0 released.

Introducing properties.

This version is compiled with latest XML and memory management libraries.



[December 08, 2005]  Version 3.1.5 released.

Lots of bugfixes and new features: check out documentation, look for [3.1.5] version-marks.



[December 24, 2004]  Version 3.1.4 released.

Several bugfixes.

ODBC: changed recommended connection strings. DSN is inconvinient and not required actually–there is simple way to connect without one.

Hashfile: increased limit of size of data that can be stored there: now key+value can be up to 8000 bytes.

Win32, IIS: added support to help using "Page not find" error to organize virtual adresses (an analogue to Apache/mod_rewrite).



[May 28, 2004]  Version 3.1.3 released.
Bugfix release, minor changes.

[November 07, 2003]  Version 3.1.1 released.
String operations speed increased two times.
UTF-8 support in methods string.upper/lower (Simple case).

[July 25, 2003]  Version 3.1.0 released.
Now memory occupied by unused objects can be freed (“unused”—not referenced from variables): ^memory:compact[], $status:memory.

[July 25, 2003]  Version 3.0.8 released

[December 27, 2002]  Version 3.0.7 released

[December 16, 2002]  Version 3.0.6 released

[August 02, 2002]  Version 3.0.5 released

[June 13, 2002]  “Lesson 6. Working with XML

[April 29, 2002]  Official Parser 3.0 release.
Published: source code;
binary versions for Win32, FreeBSD, Linux;
documentation on language (in Russian) and source code.