Changes For Bug 352
[oota-llvm.git] / projects / Stacker / lib / compiler / StackerParser.y
index cded9645b692749df818163a069ace8e81ed9c72..40411d962804b7447c4ee54df9ac580bc819a405 100644 (file)
@@ -1,4 +1,4 @@
-//===-- llvmAsmParser.y - Parser for llvm assembly files --------*- C++ -*-===//
+//===-- StackerParser.y - Parser for Stacker programs -----------*- C++ -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,22 +7,17 @@
 // 
 //===----------------------------------------------------------------------===//
 //
-//  This file implements the bison parser for LLVM assembly languages files.
+// This file implements the bison parser for Stacker programs.
 //
 //===----------------------------------------------------------------------===//
 
-%debug
-
 %{
 #include "StackerCompiler.h"
 #include "llvm/SymbolTable.h"
 #include "llvm/Module.h"
-#include "llvm/iTerminators.h"
-#include "llvm/iMemory.h"
-#include "llvm/iOperators.h"
-#include "llvm/iPHINode.h"
-#include "Support/STLExtras.h"
-#include "Support/DepthFirstIterator.h"
+#include "llvm/Instructions.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/DepthFirstIterator.h"
 #include <list>
 #include <utility>
 #include <algorithm>
@@ -41,7 +36,7 @@ int yyparse();
   llvm::Module*                ModuleVal;
   llvm::Function*      FunctionVal;
   llvm::BasicBlock*    BasicBlockVal;
-  uint32_t              IntegerVal;
+  int64_t               IntegerVal;
   char*                 StringVal;
 }
 
@@ -57,7 +52,7 @@ int yyparse();
 
 /* 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 
@@ -111,8 +106,8 @@ Word : STRING                                       { $$ = SCI->handle_string( $1 ); } ;
 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 ); } ;