|a token scanner DFA for indirection operator * ? email@example.com (RonG) (2004-03-26)|
|Re: a token scanner DFA for indirection operator * ? firstname.lastname@example.org (Alex Colvin) (2004-04-03)|
|Re: a token scanner DFA for indirection operator * ? email@example.com (2004-04-03)|
|Re: a token scanner DFA for indirection operator * ? firstname.lastname@example.org (Dmitry A. Kazakov) (2004-04-03)|
|Re: a token scanner DFA for indirection operator * ? email@example.com (=?ISO-8859-1?Q?Cass=E9_Hugues?=) (2004-04-15)|
|Date:||3 Apr 2004 09:10:52 -0500|
|Organization:||AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com|
|Posted-Date:||03 Apr 2004 09:10:51 EST|
RonG <firstname.lastname@example.org> schreibt:
>I'm trying to write a token scanner for C, and I'm wondering if there is a
>detrministic finite automata (DFA) or state machine for the '*'
>indirection operator(IOP), or if differentiation between the multiply
>operator and the IOP is better left to the parser.
Doesn't '*' have 3 meanings?
3. pointer (in declaration, cast-expression)
>Is it possible to determine '*' with just the previous token and a
>lookahead char, or do I need to introduce a flag?
For (3) the scanner must be able to distinguish between type names and other
>PS. I haven't looke at it yet, but I suspect the same situation can arise
And with '++' and '--' as prefix or postfix operators, and '+' and '-' as unary
or binary operators...
>[I think your life will be a lot easier if you interpret the tokens in
>the parser, not the lexer. -John]
Return to the
Search the comp.compilers archives again.