On Tuesday 19 July 2005 15:01, Evan Lavelle wrote:
> Thanks Tim. At first sight, this fix should be exactly what I need;
> however, in my case, it doesn't work... :(
>
> The problem is that COBOL has a real keyword - FUNCTION - to 'lock on'
>
> to. So, in your production:
> > xxx
> >
> > : { recogn
On 20 Jul 2005, at 09:21, Evan Lavelle wrote:
It seems me that you know that a function has been completed when
the function body top level "{" ... "}" has completed. This can
be kept track of by a bracket depth count in the lexer.
Unfortunately, the real grammar is much more complex
Hans Aberg wrote:
On 19 Jul 2005, at 17:01, Evan Lavelle wrote:
The only way that I know a new function is coming up is that an
existing function has just completed: there's no convenient keyword
to give me warning. [If my grammar really was this simple, then I
could probably use another t
On 19 Jul 2005, at 17:01, Evan Lavelle wrote:
The problem is, in my input, there aren't *any* context-independent
keywords (not in this case, anyway). This is equivalent to the
COBOL problem where FUNCTION is optional. The grammar looks like this:
program : function_list ;
function_list
Thanks Tim. At first sight, this fix should be exactly what I need;
however, in my case, it doesn't work... :(
The problem is that COBOL has a real keyword - FUNCTION - to 'lock on'
to. So, in your production:
xxx
: { recognize_function_names = true; } FUNCTION valid_function
;
the lexer c
Evan Lavelle wrote:
> I've got a problem where I need some communication back from Bison to
> Flex (in this case, I need Flex to return two different tokens for the
> same input, depending on context).
>
> The procedure is something like:
>
> 1 - parser determines context and sets global flag for
I've got a problem where I need some communication back from Bison to
Flex (in this case, I need Flex to return two different tokens for the
same input, depending on context).
The procedure is something like:
1 - parser determines context and sets global flag for lexer
2 - lexer checks flag,