[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: boolean operators
- From: Gunnar Zötl <gz@...>
- Date: Fri, 29 Sep 2006 20:24:12 +0200
Nick Gammon wrote:
NG> The lexer can be told whether or not to consider a sign as a separate
NG> token, I have written ones that do that.
NG> For example, after getting a symbol (x in your example), it is not
NG> syntactically correct for it to be followed by a number (eg. x 5) so
NG> the next "+" must be an operator token, not the start of a number.
actually, the unit recognizing such things would be the parser. The
lexer just knows how to recognize tokens. However, if it is the parser
recognizing negative numbers, and not the lexer, then the parser can
easily be written in a way to recognize such stuff.
Not advocating anything, just nitpicking ;-)
Gunnar
- References:
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, David Jones
- Re: boolean operators, Nick Gammon
- Re: boolean operators, David Given
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Luiz Henrique de Figueiredo
- Re: boolean operators, Nick Gammon