[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
signed numeric literals
From: |
Jack Andrews |
Subject: |
signed numeric literals |
Date: |
Fri, 19 Sep 2008 01:32:28 +1000 |
hi guys,
in the context of a C like language, how do i parse/lex a signed
literal? eg: "-1". (speech marks excluded)
in the lexer, i can't tell if we're in an expression eg: "2-1" or
if we're in assigment: "int x=-1". i've studied the freely available
C grammar for hints, but can't find an answer. in know of at least
one language that avoids this problem by using '_' instead of '-'.
ta, jack
- signed numeric literals,
Jack Andrews <=