Permalink
Browse files

renaming token types to be consistent

  • Loading branch information...
1 parent cdafb37 commit 5aa83c240666991a50b8b312b25eeb4e439cb723 @thejoshwolfe thejoshwolfe committed Sep 18, 2010
Showing with 10 additions and 10 deletions.
  1. +3 −3 pascal.l
  2. +7 −7 pascal.y
View
@@ -90,11 +90,11 @@ Z [zZ]
[0-9]+ {
yylval.literal_integer = new LiteralInteger(Utils::string_to<int>(yytext), line_number);
- return TOKEN_DIGIT_SEQUENCE;
+ return TOKEN_LITERAL_INTEGER;
}
[0-9]+\.[0-9]+ {
yylval.literal_real = new LiteralReal(Utils::string_to<float>(yytext), line_number);
- return TOKEN_REAL;
+ return TOKEN_LITERAL_REAL;
}
"'" {
@@ -111,7 +111,7 @@ Z [zZ]
}
}
yylval.literal_string = new LiteralString(yytext, line_number);
- return TOKEN_STRING;
+ return TOKEN_LITERAL_STRING;
}
{T}{R}{U}{E} {
View
@@ -62,9 +62,9 @@ Program * main_program;
%token KEYWORD_VAR
%token KEYWORD_WHILE
-%token <literal_integer> TOKEN_DIGIT_SEQUENCE
-%token <literal_real> TOKEN_REAL
-%token <literal_string> TOKEN_STRING
+%token <literal_integer> TOKEN_LITERAL_INTEGER
+%token <literal_real> TOKEN_LITERAL_REAL
+%token <literal_string> TOKEN_LITERAL_STRING
%token <literal_boolean> TOKEN_LITERAL_BOOLEAN
%token <identifier> TOKEN_IDENTIFIER
@@ -204,7 +204,7 @@ type_denoter : array_type {
$$ = new TypeDenoter(TypeDenoter::BOOLEAN);
};
-array_type : KEYWORD_ARRAY KEYWORD_LEFT_BRACKET TOKEN_DIGIT_SEQUENCE KEYWORD_DOT_DOT TOKEN_DIGIT_SEQUENCE KEYWORD_RIGHT_BRACKET KEYWORD_OF type_denoter {
+array_type : KEYWORD_ARRAY KEYWORD_LEFT_BRACKET TOKEN_LITERAL_INTEGER KEYWORD_DOT_DOT TOKEN_LITERAL_INTEGER KEYWORD_RIGHT_BRACKET KEYWORD_OF type_denoter {
$$ = new ArrayType($3, $5, $8);
};
@@ -370,11 +370,11 @@ sign : KEYWORD_PLUS {
$$ = -1;
};
-primary_expression : TOKEN_DIGIT_SEQUENCE {
+primary_expression : TOKEN_LITERAL_INTEGER {
$$ = new PrimaryExpression($1);
-} | TOKEN_REAL {
+} | TOKEN_LITERAL_REAL {
$$ = new PrimaryExpression($1);
-} | TOKEN_STRING {
+} | TOKEN_LITERAL_STRING {
$$ = new PrimaryExpression($1);
} | TOKEN_LITERAL_BOOLEAN {
$$ = new PrimaryExpression($1);

0 comments on commit 5aa83c2

Please sign in to comment.