parser
Parser 3 — simple and convenient object-oriented language which allows creating good sites in short time.
parser bird
Download Parser:    Windows    Linux    Mac OS X   FreeBSD 8 9 10 11
What is Parser?
Parser is a simple and convenient object-oriented language, which allows creating good sites in short time. Parser was started in Art. Lebedev studio in 1997. Nowadays, most of sites created by Art. Lebedev studio are made with Parser.
What is it for, anyway?
Language is designed and optimized in such a way that it would be more convenient to create good sites. Language supports working with forms, cookies, table files, databases, and XML. Support for user operators and classes allows to extend its functionality.
There is PHP, what Parser is for?
PHP is a programming language requiring appropriate training. Parser has simple tools that resolve complex tasks and is especially good in that it allows mere mortals to create and maintain complex dynamic sites without spending too much time.
April 28, 2017

Version 3.4.5 released

Optimizations that accelerated access to variables, output of results and processing of expressions were carried out. In tests, the total acceleration is up to 15%.

The ^reflection:create[ $.class[class name] $.constructor[name of the constructor] $.arguments[hash of arguments] ] call is implemented, in which a variable number of arguments is supported.

^reflection:mixin[$source;options] method is added to copy fields and methods from one class to another. By default it copies to the class from which the method is called, that can be changed using $.to[where]. You can skip methods copying using $.methods(false) or the fields copying using $.fields(false). If you need to overwrite existing methods or fields when copying, you need to specify $.overwrite(true).

Using the new ^reflection:stack[] method it is possible to see the call stack in runtime. Unlike the exception stack, ^reflection:stack[] returns only the methods written in the parser. It is possible to see the parameters using $.args(true) and local variables using $.locals(true).

The object model was slightly changed. Now it’s more correct to say that “an object has a prototype class” then “an object is an instance of a class”. The difference is only when working with the static class properties from an object. By analogy with JavaScript — when reading $self.class_field, the class_field in the class is accessed, but when writing $self.class_field[value], the entry goes to the object and subsequent calls to $self.class_field read the value from the object.

It is now possible to work effectively with the object as with a hash using ^reflection:fields_reference[$o]. You could write $h[^hash::create[$o]] before, but fields_reference does not create a new hash with the same keys as the fields in the object, but creates a special linked hash, directly associated with the object. For example, if ^h.delete[name] called, the field name is removed in the associated object.

The operator ^return[] (^return[result]) is implemented, it exits the method when called.

The ^break[] and ^continue[] operators now have an optional parameter with the condition of their execution. Now, instead of ^if($condition){ ^break [] }, you can write ^break($​​condition).

Using the $method.name syntax, you can find out the name of the method.

Windows version now uses the Unicode API to work with files, so you can work with Russian file names not only in the Windows-1251 encoding, but also in UTF-8.

Limit on the size of file to be read by parser is added (by default 512MB). Under Windows ^file::stat[] now works correctly with files larger than 4 gigabytes.

Parameter $.from-charset[encoding] is added in ^file::create[]. Now the parser can be used to transcode data in any direction, not just to the specified encoding, as before.

With ^hash.contains[_default] you can check whether the default value was set in the hash.

A subtle point was associated with the _default key — not only the developer could set such a value. If the keys of the hash ware received from an external source, then the user could also pass _default, which could lead to incorrect code execution. Now _default is only perceived if it is written in the parser code.

The hash, in which only _default is specified, is now considered defined (def $h).

Hash write lock during hash elements iteration was removed.

It is possible to create a hash based on the file properties using ^hash::create[$file].

^reflection:method[$method;$object] call is added. When the result is called, $method will work in the context of $object ($self would be $object). This way, you can add or override the method in a specific object.

^reflection:filename[class or object or method] method is added to get the name of the file in which the class or method was defined.

To get information about the method reference, the ^reflection:method_info[$junction] call is supported.

With the new ^reflection:tainting[$string] method, you can see what transformations a string requires.

The result of ^reflection:methods[class name] call is now sorted in in reverse to the order of adding methods. With the optional $.reverse(false) option, you can specify a direct order.

When modules are used with @USE, the ^use[] operator is now called. It can be redefined and own logic for loading modules can be implemented. The parser implementation of the logic used in the parser ^use[] looks like this.

$.encloser[] option is added to ^table::create[] (similar to existing one in ^table::load[]).

The access to $string.something is now allowed (does not cause an exception) not only for empty strings, but for whitespace strings as well.

When local variable result is defined, the optimization is turned on, which removes all whitespace characters during compilation. Now in this mode you can use non-whitespace characters as well — earlier this led to an exception, now these characters are output to the result.

When the date is printed in the ISO 8601 format (^date.iso-string[]), $.colon(true/false) option was added to exclude the colon in the time zone, $.ms(true) option to add milliseconds (always .000) and $.z(false) option for the UTC time zone to be recorded as +00:00. When parsing a date the format of the time zone +hhmm is now understood.

In the date constructor with an enumeration of fields, an additional parameter in which you can specify a time zone is added.

Some date fields (year, month, day, hour, minute, second) can be changed, $date.year(2017).

In the configuration method @conf[], you can set the limit of iterations in cycles and the maximum depth of recursion. $LIMITS[ $.max_loop(20000) $.max_recoursion(1000) ] - the default values.

If $response:status is set to less than 100, it will be returned as the exit code of the parser process.

The new implementation of $caller has fixed some errors and allows you to get the calling method using $caller.method.

When sending messages (^mail:send[]), the multipart splitter is made random, the obsolete error-to header is removed.

In ^table.hash[] method you can now dynamically set not only the key, but also the value, ^table.hash {...;...}

^curl:load[] returns a hash tables with tables of all headers by analogy with ^file::load[].

A number of bugs were fixed.

April 28, 2016

The updated website is launched

To the day of the fourteenth “Parser” birthday the updated website is launched. Solutions for different tasks are grouped by tags in new “Library” section. Registered users have the possibility by their own add their sites to the “In action” section.

International Isotope Society—The International Isotope Society is a chartered, international organization independent of special interests groups or companies, makers or users of isotopes (radioactive or stable), etc. It is run entirely by the enthusiastic and unselfish dedicated vol / CrossRoads Media

Mega for Business website / Art. Lebedev Studio

Welcome to Haven Hotel & Suites!—Haven Hotel Ocean City, MD. On-line reservation system. / Mikhail Kozlov

LANcet Chat 2.3 - Free LAN communication - Home—LANcet Chat project. / Ilya Polsakov

Business Cards—business cards / Pavel Sochnev

Web Hosting—hosting provider (USA) / Mishka Serverniy