Commit 32fce705 authored by Michael Meskes's avatar Michael Meskes

Added new version of ecpg's parser generator script. This one was written by

Andy Colson <andy@squeakycode.net>.
parent 8e2d8b14
...@@ -57,8 +57,8 @@ else ...@@ -57,8 +57,8 @@ else
@$(missing) flex $< $@ @$(missing) flex $< $@
endif endif
preproc.y: ../../../backend/parser/gram.y parse.pl ecpg.addons ecpg.header ecpg.tokens ecpg.trailer ecpg.type preproc.y: ../../../backend/parser/gram.y parse2.pl ecpg.addons ecpg.header ecpg.tokens ecpg.trailer ecpg.type
$(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@ $(PERL) $(srcdir)/parse2.pl $(srcdir) < $< > $@
$(PERL) $(srcdir)/check_rules.pl $(srcdir) $< $(PERL) $(srcdir)/check_rules.pl $(srcdir) $<
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h
......
...@@ -3,7 +3,7 @@ ECPG modifies and extends the core grammar in a way that ...@@ -3,7 +3,7 @@ ECPG modifies and extends the core grammar in a way that
defined in ecpg.tokens, types are defined in ecpg.type defined in ecpg.tokens, types are defined in ecpg.type
2) most tokens from the core grammar are simply converted 2) most tokens from the core grammar are simply converted
to literals concatenated together to form the SQL string to literals concatenated together to form the SQL string
passed to the server, this is done by parse.pl. passed to the server, this is done by parse2.pl.
3) some rules need side-effects, actions are either added 3) some rules need side-effects, actions are either added
or completely overridden (compared to the basic token or completely overridden (compared to the basic token
concatenation) for them, these are defined in ecpg.addons, concatenation) for them, these are defined in ecpg.addons,
...@@ -20,7 +20,7 @@ rules concatenated together. e.g. if gram.y has this: ...@@ -20,7 +20,7 @@ rules concatenated together. e.g. if gram.y has this:
ruleA: tokenA tokenB tokenC {...} ruleA: tokenA tokenB tokenC {...}
then "dumpedtokens" is "ruleAtokenAtokenBtokenC". then "dumpedtokens" is "ruleAtokenAtokenBtokenC".
"postfix" above can be: "postfix" above can be:
a) "block" - the automatic rule created by parse.pl is completely a) "block" - the automatic rule created by parse2.pl is completely
overridden, the code block has to be written completely as overridden, the code block has to be written completely as
it were in a plain bison grammar it were in a plain bison grammar
b) "rule" - the automatic rule is extended on, so new syntaxes b) "rule" - the automatic rule is extended on, so new syntaxes
......
...@@ -1591,7 +1591,7 @@ ECPGCKeywords: S_AUTO { $$ = mm_strdup("auto"); } ...@@ -1591,7 +1591,7 @@ ECPGCKeywords: S_AUTO { $$ = mm_strdup("auto"); }
* CONNECTION can be added back in all_unreserved_keyword, but CURRENT and * CONNECTION can be added back in all_unreserved_keyword, but CURRENT and
* INPUT are reserved for ecpg purposes. * INPUT are reserved for ecpg purposes.
* *
* The mentioned exclusions are done by $replace_line settings in parse.pl. * The mentioned exclusions are done by $replace_line settings in parse2.pl.
*/ */
all_unreserved_keyword: unreserved_keyword { $$ = $1; } all_unreserved_keyword: unreserved_keyword { $$ = $1; }
| ECPGunreserved_interval { $$ = $1; } | ECPGunreserved_interval { $$ = $1; }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment