help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about lr(1) parsers


From: Hans Aberg
Subject: Re: about lr(1) parsers
Date: Mon, 3 Jul 2006 10:53:54 +0200

On 3 Jul 2006, at 10:43, chinlu chinawa wrote:

What I'm looking for is a parser, or as I understand
it, a way in which I can define new keywords whilst
being able to process them as well as any arguments it
may take.

Keywords, or hardwired names, are normally added in the lexer, which may be generated by Flex. If you want to have constructs such as 'define <name>...', one way to do it is to make a lookup table, where <name> is entered along with syntactic and semantic data. When the lexer finds a name, it checks the lookup table, and if found, returns the correct token and passes the semantic data to the parser.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]