Nikita Popov
6996db1e3a
Build node attributes inside semantic action methods
...
Minor performance improvement for parsing, also allows to access
attributes with higher granulity in the parser, though this is not
currently done.
* #n can now be used to access the stack position of a token. $n
is the same as $this->semStack[#n]. (Post-translate $n will
actually be the stack position.)
* $attributeStack is now $this->startAttributeStack and
$endAttributes is now $this->endAttributes.
* Attributes for a node are now computed inside the individual
reduction methods, instead of being passed as a parameter.
Accessible through the attributes() macro.
2015-04-26 11:55:59 +02:00
Nikita Popov
7a40498cb4
Regenerate parser
...
Also drop the error() parser macro.
2015-04-19 18:12:56 +02:00
Nikita Popov
0f556c16f5
Fix a few more Scalar\String_ occurances
...
Totally forgot that the parser uses macros...
2015-03-21 18:54:52 +01:00
nikic
0faa844a75
Separate parser code from generated data
2014-04-20 00:19:35 +02:00
Martin Hasoň
d6eac28955
Fixed typo
2014-02-12 14:12:55 +01:00
nikic
f82862ec9c
Port library to use namespaces, with BC for old names
2014-02-06 20:29:35 +01:00
nikic
759c04db9b
Turn rebuildParser.php into a CLI script
...
The paths are now more generic so it can be run from any directory, not
just grammar/.
2012-10-19 19:11:47 +02:00
nikic
2f5ebf7c4d
Store line and doc comment as attributes
2012-05-04 10:16:59 +02:00
nikic
cf3117d82d
Fix parsing of integers that overflow into floats
...
Integers in hex/oct/bin notation that overflowed into floats were parsed incorrectly.
2012-01-15 16:54:48 +01:00
nikic
db3181aff1
More test coverage and doc string parsing fixes
...
The parser didn't account for the additional newline after the content of doc strings, which is left there by the tokenizer for some reason. Additoinally esacape sequences were parsed in nowdoc strings.
Additionally this contains some minor changes to the grammar: Some _list nonterminals were refactored to have the possible single elements in a reparate rule and only assemble those single elements. (This reduces duplication and gives better assignment of line number context.)
2011-12-04 16:52:43 +01:00
nikic
3a4cc1a0f0
Do not distribute debug parser anymore
...
The debug parser (and the debug y.output) can be still built using rebuildParser.php?debug.
2011-11-27 21:48:34 +01:00
nikic
933bebb9b8
Fix parsing of special int syntaxes
...
Also add the means to test code parsing.
2011-11-26 16:09:39 +01:00
nikic
f202aa9814
[API] Make all constructors specialized
...
For nodes that accept many optional arguments I chose to keep the $subNodes argument, but provide default values instead.
2011-10-28 19:06:24 +02:00
nikic
17a81b5c8f
Properly parse escape sequences:
...
* Add support for oct and hex escape sequences
* Take used quote type into account when parsing encapsed strings
2011-08-20 10:40:27 +02:00
nikic
96350be172
Implement the debug parser by extending the normal parser. That way there is no need to repeat all action codes and lookup tables twice.
2011-08-14 15:36:15 +02:00
nikic
297c9ac290
Use moriyoshi's fork of kmyacc, which fixes most of the issues of kmyacc with PHP
2011-08-14 14:52:24 +02:00
nikic
344913d44b
Add specialized constructors for assignment operations
2011-08-11 08:35:10 +02:00
nikic
f67ff50550
Give all Scalar nodes and the special nodes Name and Variable specialized constructors for easier use
2011-08-09 15:07:05 +02:00
nikic
afd6c70b77
Merge preprocessor.php into rebuildParser.php. Don't distribute the temporary preprocessed grammar anymore
2011-08-04 12:46:48 +02:00
nikic
70306000e8
In rebuildParser.php output stderr too (so there actually is output)
2011-08-04 11:47:29 +02:00
nikic
afcf7777bf
Don't generate y.output file anymore as it really bloats diffs
2011-08-04 11:12:19 +02:00
nikic
f11f228074
Associate some line information with nodes (currently the line the node ends in, as the starting line is harder to fetch)
2011-06-12 17:12:47 +02:00
nikic
620525a5da
Prefix all classes with PHPParser_
2011-06-05 18:40:04 +02:00
nikic
df82e3db45
Replace yydebug flag with separate debug parser "ParserDebug"
...
Debugging shouldn't be necessairy normally, but carries a 25% performance overhead.
2011-05-29 20:51:15 +02:00
nikic
eeb63065be
a) changes node structure (Stmt_, Expr_, ...) b) fixes parsing of x::$y[z]
...
Sorry for that one large commit. Won't happen again.
2011-05-27 18:42:36 +02:00