help-bison
[Top][All Lists]
Advanced

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

push simulation


From: Fiordean Dacian
Subject: push simulation
Date: Wed, 5 Jun 2002 15:59:59 +0200

 
Hi all,
 
I've saw for a parser generator tool named Visual Parse++ (an old version) the possibility to push and pop from the stack using a command whithin a production. Is there any possibility to simulate this with Bizon?
 
Here is an example:
 
(a|A)(c|C)(t|T)(i|I)(o|O)(n|N)            ..., %push ExpAction
 
%_expression_ ExpAction
[^;]+                ...., %pop
 
What I need is in fact to parse a production like this
 
=========lex==========
 
(a|A)(c|C)(t|T)(i|I)(o|O)(n|N)        { return TK_ACTION; }
 
...
 
[^;]+    {...
            return TK_STRING;
            }
 
======Bizon===========
 
action : TK_ACTION string end
            {
                ......
            }
        ;
 
string : TK_STRING;
         ;
 
 
...But the problem with this lexer is that the last regular expresion ( [^;] ) eats all.
 
Example:
    action extern 'dnbbsdnsdbdsn hsgs ssqhsq    '  xyz;
 
is eated by this _expression_. I need action to be eated by the first and only the rest to be eated by the last _expression_.
 
So I need a way when the parser reduces the action production to eat all the text follwed by this and which matches the lexer's last _expression_. Then the _expression_ must be poped and modelated for my needs.
I've saw the conditional states but I don't know if are a solution and how to access them from parser.
 
Thx,
// D.
 
 

reply via email to

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