f



Converting SQL89 YACC rules to Parse::RecDescent

I'm having a left-recursion problem converting an LALR (YACC) spec to
LL (Parse::RecDescent).  I've read a couple articles on eliminating
left recursion, and they have helped with the simpler rules.  However,
I have one rule that is giving me trouble.  Here is the rule with one
of its dependencies:

search_condition:
  search_condition /OR/i search_condition
 | search_condition /AND/i search_condition
 | /NOT/i search_condition
 | '(' search_condition ')'
 | predicate

predicate:
  comparison_predicate
 | between_predicate
 | like_predicate
 | test_for_null
 | in_predicate
 | all_or_any_predicate
 | existence_test

I'm assuming I would need to supply additional subrules.  Any
suggestions?
0
Tompkins (1)
7/4/2003 3:58:29 AM
comp.compilers 3310 articles. 1 followers. Post Follow

0 Replies
911 Views

Similar Articles

[PageSpeed] 6

Reply:

Similar Artilces:

YACCaty YACC
Hi, Has anybody already written a LEX/YACC combo for parsing YACC grammars? Would it be better to try to parse the state table output.y you get by running yacc in debug mode? I'd like to create a tree for arbitrary YACC grammars (well, 'arbitrary' within reason). I'm aiming towards automatically generating a GUI 'Sentence Builder' from a grammar which offers users the ability to begin at the root "Start" token and choose how to progress according to which tokens the grammar would allow next. My secondary goal is to visualise the resulting sentences as a tre...

Parse::RecDescent and unordered rules
Hi. I'm completely new to Parse::RecDescent and parsing in general (I know my regexes, though). I'm trying to write a parser to read a config-file, and I've managed to rules for all the relevant parts of the config-file, and everything seems to work fine. But, there are several parts of the config-file where the order doesn't (well, shouldn't) matter, and I was wondering if there is a simple way to tell Parse::RecDescent that the order of these rules doesn't matter? Here's an example: alphanum: /[A-Za-z0-9_]/ word: alphanum(s) name: 'NAME' word rank...

Parse::RecDescent problem regarding rule matching
I'm a Perl newbie and I've started to look into the Parse::RecDescent module. Meanwhile I've stumbled on a rule matching problem. I've defined a couple of rules to be able to deal with two different types of numbers: integers and decimal fractions with a single decimal place. The problem is that RecDescent returns false positives by matching the integer rule on decimal fraction numbers. As far as I can tell, that could only happen if somehow RecDescent doesn't make any use of any terminal symbol to specify if the rule really matches a pattern, which I believe could...

searching for a rule engine that compiles rules, no reflection
Hi, Does anyone have heard of rules engines (could be really basic ones) that generates byte code to perform the evaluations instead of using reflection and interpretation? I have searched a while, but the docs are always about features, not so much implementations. Thanks. On Wed, 12 Apr 2006 22:52:17 GMT, NOBODY <antispam@0.0.0.0> wrote, quoted or indirectly quoted someone who said : >Does anyone have heard of rules engines (could be really basic ones) that >generates byte code to perform the evaluations instead of >using reflection and interpretatio See http://mindpr...

Converting Assura rule deck to Diva rule deck
I'm working on installing a PDK that only comes with Assura DRC rule decks. Our current setup only has Diva. Is there an easy way to convert or use the Assura rule decks for Diva use? On 22 Aug 2005 15:22:42 -0700, "just21andy" <just21andy@hotmail.com> wrote: >I'm working on installing a PDK that only comes with Assura DRC rule >decks. Our current setup only has Diva. Is there an easy way to convert >or use the Assura rule decks for Diva use? There has never been an effort to create an Assura to Diva translator, but most of the commonly used Assura rules we...

Compiled or not compiled
I need to distinguish between two situations: one when a Matlab function is run from Matlab command window and the other one when it is run in compiled mode. Any ideas how to do this? Thanks Tomy Duby "Tomy Duby" <tomy.duby@agilent.com> wrote in message news:idq8q8$85k$1@fred.mathworks.com... > I need to distinguish between two situations: one when a Matlab function > is run from Matlab command window and the other one when it is run in > compiled mode. > Any ideas how to do this? HELP ISDEPLOYED. -- Steve Lord slord@mathworks.com comp.s...

To compile or not to compile
Is there some benefit in compiling the apache source yourself? -- //Points ------------------------------------------------------------ http://underthebed.homeip.net ...

Compile or not compile?
There's something that sometimes in while it bores me a little bit. How do I know if I need to compile a function/procedure or it will be able to compile "on fly". At the beginning I thought this was related to the paths idl "knew", but this happens for two functions/routines in the same directory. Can someone tell when a function can be runned without be compile? Nuno Oliveira wrote: > There's something that sometimes in while it bores me a little bit. How > do I know if I need to compile a function/procedure or it will be able > to compile &quo...

compiler with yacc
I it possible to write an interpretor with yacc (and lex) ? It seems easy for the basis instruction, but I don't understand how it is possible to do conditional instructions or functions. How specify that a part of the code may not be interpreted at first, but later when called (functions) or may not be interpreted (if, else, then, if, elseif, endif etc..) or may be interpreted X times (while, do, for, loop, etc..) -- Thanks in advance. John. rage coder wrote: > I it possible to write an interpretor with yacc (and lex) ? > It seems easy for the basis instruction, but I don...

Compiling Compiler
Hi there, I need some advice/opinion of the experts out there regarding compilers. I have sun cc compiler that supports 64 bit environment. Now, I compile ACK using this compiler.This should give a compiler that supports 64bit environment. Since the output files are in Solaris format, I compile the ACK source *once again* using the just compiled ACK compiler so that I get Minix object and binary files. Now my questions is that does this 2nd version of ACK be able to produce true 64bit code? Sanky wrote: > Hi there, > > I need some advice/opinion of the experts out there regarding...

which compiler compiled?
Is there a way I can tell which compiler compiled an executable? I looked at the file with a hex editor and didn't see anything obvious. Lawrence "Lawrence" <just4me@nowhere.com> writes: > Is there a way I can tell which compiler compiled an executable? Yes with some compilers and some executable formats. E.g. on HP-UX for PA-RISC: $ aCC leak.C $ odump -compunit a.out ... 6 0 ANSI C++ leak.C /tmp ctcom options = -inst compiletime -diags 523 -inline_power 1 -longbranch 2 -unique_strings on -cachesize 256 B...

To compile or not to compile
Is there some benefit in compiling the apache source yourself? -- //Points ------------------------------------------------------------ http://underthebed.homeip.net ...

Convert unix c++ compiler flags to windows compiler flags?
I have these compiler flags in a CMakeList.txt file for a linux code: SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -lX11 -Dcimg_use_xshm -lXext -Dcimg_use_xrandr -lXrandr -O3 -fpermissive -march=nocona -m64 -ffast-math -funroll-loops -finline-functions") Any ideas on who I convert those to windows (Visual Studio 2008) flags? In article <4a283fa0$0$90272$14726298@news.sunsite.dk>, mlt <asdf@asd.com> wrote: >I have these compiler flags in a CMakeList.txt file for a linux code: > -O3 -fpermissive -march=nocona -m64 -ffast-math -funroll-loops -finline-f...

compiling Qt .... compiling Qt ....compiling Qt.... compiling Qt
I got myself new kernel from kernel.org... make xconfig needs Qt (new system). So I got new Qt source this afternoon. It is still compiling.... Who said MS is bloat has not done this. What does Qt do? Dunno, how about xforms for xconfig? On Thu, 02 Feb 2006 19:18:09 +0000, Jan Panteltje wrote: > Dunno, how about xforms for xconfig? Why not curses based? menuform -- Hilsen/Regards Michael Rasmussen http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917 On a sunny day (Thu, 02 Feb 2006 21:55:33 +0100) it happened Michael Rasmussen <mir@miras.or...

Web resources about - Converting SQL89 YACC rules to Parse::RecDescent - comp.compilers

Resources last updated: 1/24/2016 6:37:26 AM