help-flex
[Top][All Lists]
Advanced

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

Look ahead question (trailing context)


From: Henrik Sorensen
Subject: Look ahead question (trailing context)
Date: Wed, 31 Mar 2004 16:12:38 +0100
User-agent: KMail/1.5.1

hi list,

Does anybody have an idea of how to look the token following a set of matching 
parentesis?

In pl1 it is valid to use keywords as variable names, and this of course makes 
the grammar very ambiguous, and not really lalr(1). So I would like the 
scanner to help out with some of this.

In pl1 arrays are referenced using parentesis around the subscripts.

So if both the previously matched token and the token following 
the matched ')'  is known, it can be determined whether a matched keyword 
token, is really a variable name or a keyword.

Eg:
1) The display statement:
        DISPLAY(1) ; 
2)  The array variable named display:
        DISPLAY(1)=4;

in the first sample flex should return the DISPLAY keyword token for the 
statement and in the second return VARNAME for variable.

Any ideas ?

Thanks.

Henrik Sorensen
http://pl1gcc.sourceforge.net





reply via email to

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