don't care data in yacc
19 May 1996 14:30:34 -0400

          From comp.compilers

Related articles
don't care data in yacc (1996-05-19)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 19 May 1996 14:30:34 -0400
Organization: Internet Atlanta
Keywords: yacc, question

Hi All,

I was wondering is there a way in yacc/bison to enter a don't care state for
a grammar without having to completely specify every token I don't care

for example, say I wanted to ignore everything after the
'WHERE' portion of a SQL SELECT statement:

SELECT ~~specified~~ FROM ~~specified~~ WHERE ~IGNORE THIS~

I have written a bison grammar to parse SELECT statements. The
'~~specified~~' portions of the about example are specified in that
grammar. My problem is that I don't really care about the '~IGNORE THIS~'
and I don't know the best way to tell my grammar this. This wouldn't be a
problem, if I stopped parsing as soon as I hit the WHERE, but I could have
multiple SELECT statements in a file and I also have to have the ability to
ignore subquery SELECT which may show up in the WHERE clause.

Thanks, in advance,

[I'd use lexical hackery to tell the lexer to skip ahead until it hit an
end of ignore section marker. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.