Section 5.4 (Context dependent precedence) in the official manual (
http://www.gnu.org/software/bison/manual/html_mono/bison.html#Contextual-Precedence)
contains the answer:
Here is how %prec solves the problem of unary minus. First, declare a
precedence for a fictitious terminal symbol named UMIN
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 a