begin { return BEGINTOK; }
end { return ENDTOK; }
begin { return BEGINTOK; }
end { return ENDTOK; }
-true { return TRUE; }
-false { return FALSE; }
+true { return TRUETOK; }
+false { return FALSETOK; }
declare { return DECLARE; }
global { return GLOBAL; }
constant { return CONSTANT; }
declare { return DECLARE; }
global { return GLOBAL; }
constant { return CONSTANT; }
%type <StrVal> Name OptName OptAssign
%type <StrVal> Name OptName OptAssign
-%token IMPLEMENTATION ZEROINITIALIZER TRUE FALSE BEGINTOK ENDTOK
+%token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK
%token DECLARE GLOBAL CONSTANT VOLATILE
%token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING
%token OPAQUE NOT EXTERNAL TARGET ENDIAN POINTERSIZE LITTLE BIG
%token DECLARE GLOBAL CONSTANT VOLATILE
%token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING
%token OPAQUE NOT EXTERNAL TARGET ENDIAN POINTERSIZE LITTLE BIG
ThrowException("Constant value doesn't fit in type!");
$$ = ConstantUInt::get($1, $2);
}
ThrowException("Constant value doesn't fit in type!");
$$ = ConstantUInt::get($1, $2);
}
- | BOOL TRUE { // Boolean constants
+ | BOOL TRUETOK { // Boolean constants
$$ = ConstantBool::True;
}
$$ = ConstantBool::True;
}
- | BOOL FALSE { // Boolean constants
+ | BOOL FALSETOK { // Boolean constants
$$ = ConstantBool::False;
}
| FPType FPVAL { // Float & Double constants
$$ = ConstantBool::False;
}
| FPType FPVAL { // Float & Double constants
| FPVAL { // Perhaps it's an FP constant?
$$ = ValID::create($1);
}
| FPVAL { // Perhaps it's an FP constant?
$$ = ValID::create($1);
}
$$ = ValID::create(ConstantBool::True);
}
$$ = ValID::create(ConstantBool::True);
}
$$ = ValID::create(ConstantBool::False);
}
| NULL_TOK {
$$ = ValID::create(ConstantBool::False);
}
| NULL_TOK {
{Colon} { return COLON; }
{Semi} { return SEMI; }
{Colon} { return COLON; }
{Semi} { return SEMI; }
-TRUE { return TRUE; }
-FALSE { return FALSE; }
-ON { return TRUE; }
-OFF { return FALSE; }
+TRUE { return TRUETOK; }
+FALSE { return FALSETOK; }
+ON { return TRUETOK; }
+OFF { return FALSETOK; }
{Less} { return LESS; }
LT { return LESS; }
{More} { return MORE; }
{Less} { return LESS; }
LT { return LESS; }
{More} { return MORE; }
+ case TRUETOK : // -- -1
{
if (echo) bb->setName("TRUE");
push_integer(bb,-1);
break;
}
{
if (echo) bb->setName("TRUE");
push_integer(bb,-1);
break;
}
+ case FALSETOK : // -- 0
{
if (echo) bb->setName("FALSE");
push_integer(bb,0);
{
if (echo) bb->setName("FALSE");
push_integer(bb,0);
/* Terminal Tokens */
%token SEMI COLON FORWARD MAIN DUMP
/* Terminal Tokens */
%token SEMI COLON FORWARD MAIN DUMP
-%token TRUE FALSE LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL
+%token TRUETOK FALSETOK LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL
%token PLUS MINUS INCR DECR MULT DIV MODULUS NEGATE ABS MIN MAX STAR_SLASH
%token AND OR XOR LSHIFT RSHIFT
%token DROP DROP2 NIP NIP2 DUP DUP2 SWAP SWAP2 OVER OVER2 ROT ROT2
%token PLUS MINUS INCR DECR MULT DIV MODULUS NEGATE ABS MIN MAX STAR_SLASH
%token AND OR XOR LSHIFT RSHIFT
%token DROP DROP2 NIP NIP2 DUP DUP2 SWAP SWAP2 OVER OVER2 ROT ROT2
Word : INTEGER { $$ = SCI->handle_integer( $1 ); } ;
/* Everything else is a terminal symbol and goes to handle_word */
Word : INTEGER { $$ = SCI->handle_integer( $1 ); } ;
/* Everything else is a terminal symbol and goes to handle_word */
-Word : TRUE { $$ = SCI->handle_word( TRUE ); } ;
-Word : FALSE { $$ = SCI->handle_word( FALSE ); } ;
+Word : TRUETOK { $$ = SCI->handle_word( TRUETOK ); } ;
+Word : FALSETOK { $$ = SCI->handle_word( FALSETOK ); } ;
Word : LESS { $$ = SCI->handle_word( LESS ); } ;
Word : MORE { $$ = SCI->handle_word( MORE ); } ;
Word : LESS_EQUAL { $$ = SCI->handle_word( LESS_EQUAL ); } ;
Word : LESS { $$ = SCI->handle_word( LESS ); } ;
Word : MORE { $$ = SCI->handle_word( MORE ); } ;
Word : LESS_EQUAL { $$ = SCI->handle_word( LESS_EQUAL ); } ;