This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit a94365b0 authored by jdev52's avatar jdev52

added printToken to parser

parent 5983583b
......@@ -19,6 +19,8 @@ void prepareToTerminate();
void bail();
bool findEntryInAnyScope(const string theName);
void printToken(const char* tokenType, char* lexeme);
void printRule(const char*, const char*);
......@@ -26,6 +28,7 @@ int yyerror(const char* s)
{
printf("Line %d: %s\n", lineNum, s);
bail();
return 0;
}
extern "C"
......@@ -58,6 +61,7 @@ extern "C"
%type <typeInfo> N_ARITHLOGIC_EXPR N_IF_EXPR N_LET_EXPR N_ID_EXPR_LIST
%type <typeInfo> N_LAMBDA_EXPR N_ID_LIST N_PRINT_EXPR N_INPUT_EXPR
%type <typeInfo> N_EXPR_LIST N_BIN_OP N_ARITH_OP N_REL_OP N_LOG_OP N_UN_OP
/*
* Starting point.
*/
......@@ -394,6 +398,10 @@ void printRule(const char* lhs, const char* rhs)
return;
}
void printToken(const char* tokenType, char* lexeme){
printf("TOKEN: %-8s LEXEME: %s\n", tokenType, lexeme);
}
void beginScope()
{
scopeStack.push(SYMBOL_TABLE());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment