diff --git a/SQLPGrammar.y b/SQLPGrammar.y
index c38a09c2088e5cc3e1cd89f473e78bb63b626cf4..641d6bd7fbf71fd89554b916dc1fb98b8da29768 100644
--- a/SQLPGrammar.y
+++ b/SQLPGrammar.y
@@ -200,55 +200,55 @@ AttrPath
 VarIdentifier
 	: IDENTIFIER
 	{
-		printf("VarIdentifier is |%s| ", yytext);
-		$$ = create_var(yytext);
+		printf("VarIdentifier is |%s| ", identifier);
+		$$ = create_var(identifier);
 	}
 
 
 TableIdentifier
 	: IDENTIFIER
 	{
-		printf("TableIdentifier is |%s| ", yytext);
-		$$ = create_var(yytext);
+		printf("TableIdentifier is |%s| ", identifier);
+		$$ = create_var(identifier);
 	}
 
 AttrIdentifier
 	: IDENTIFIER
 	{
-		printf("AttrIdentifier is |%s| ", yytext);
-		$$ = create_var(yytext);
+		printf("AttrIdentifier is |%s| ", identifier);
+		$$ = create_var(identifier);
 	}
 
 CompOperator
 	: EQ
 	{
 		printf("CompOperator EQ\n");
-		$$ = create_op(yytext);
+		$$ = create_op("=");
 	}
 	| NE
 	{
 		printf("CompOperator NE\n");
-		$$ = create_op(yytext);
+		$$ = create_op("<>");
 	}
 	| LE
 	{
 		printf("CompOperator LE\n");
-		$$ = create_op(yytext);
+		$$ = create_op("<=");
 	}
 	| GE
 	{
 		printf("CompOperator GE\n");
-		$$ = create_op(yytext);
+		$$ = create_op(">=");
 	}
 	| LT
 	{
 		printf("CompOperator LT\n");
-		$$ = create_op(yytext);
+		$$ = create_op("<");
 	}
 	| GT
 	{
 		printf("CompOperator GT\n");
-		$$ = create_op(yytext);
+		$$ = create_op(">");
 	}
 	;
 
@@ -317,25 +317,25 @@ Term
 Integer
 	: INTEGER
 	{
-		printf("INTEGER is |%s|", yytext);
-		$$ = create_constant(yytext);
+		printf("INTEGER is |%s|", constant);
+		$$ = create_constant(constant);
 	}
 
 
 Constant
 	: INTEGER
 	{
-		printf("INTEGER is |%s|", yytext);
-		$$ = create_constant(yytext);
+		printf("INTEGER is |%s|", constant);
+		$$ = create_constant(constant);
 	}
 	| REAL
 	{
-		printf("REAL is |%s|", yytext);
-		$$ = create_constant(yytext);
+		printf("REAL is |%s|", constant);
+		$$ = create_constant(constant);
 	}
 	| STRING
 	{
-		printf("STRING is |%s|", yytext);
-		$$ = create_constant(yytext);
+		printf("STRING is |%s|", constant);
+		$$ = create_constant(constant);
 	}
 	;
diff --git a/SQLPRefExp.y b/SQLPRefExp.y
index 1b6d3d66db801c859855561fe90861e97bce8409..d20636921465623bfaddd1d944ecef8693328a54 100644
--- a/SQLPRefExp.y
+++ b/SQLPRefExp.y
@@ -34,7 +34,7 @@ SQLPRefExp
     ;
 
 OidExpLst
-    : OidExpLst ';' OidExp  
+    : OidExpLst ';' OidExp
     {
         printf("OidExpLst\n");
         $$ = create_oidexplst_operator($1, $3);
@@ -86,12 +86,12 @@ Col
 
 AttrPath
 	: AttrIdentifier
-	{ 
+	{
         printf("path id\n");
 		$$ = create_pf($1, NULL);
 	}
 	| AttrIdentifier '.' AttrPath
-	{ 
+	{
         printf("Path Function\n");
 		$$ = create_pf($1, $3);
 	}
@@ -100,21 +100,20 @@ AttrPath
 VarIdentifier
 	: IDENTIFIER
     {
-		printf("|%s| ", yytext);
-		$$ = create_var(yytext);
+		printf("|%s| ", identifier);
+		$$ = create_var(identifier);
 	}
 
 TableIdentifier
 	: IDENTIFIER
 	{
-		printf("|%s| ", yytext);
-		$$ = create_table(yytext);
+		printf("|%s| ", identifier);
+		$$ = create_table(identifier);
 	}
 
 AttrIdentifier
 	: IDENTIFIER
 	{
-		printf("|%s| ", yytext);
-		$$ = create_attr(yytext);
+		printf("|%s| ", identifier);
+		$$ = create_attr(identifier);
 	}
-
diff --git a/SQLPScanner.l b/SQLPScanner.l
index 964ddd88bd3c21afb515d64c050ebae84b17ea01..b6f3555e16335422b3e000467ee907916db12c72 100644
--- a/SQLPScanner.l
+++ b/SQLPScanner.l
@@ -32,6 +32,8 @@
 
 int LineNumber = 1;
 char LineBuffer[200];
+char identifier[200];
+char constant[200];
 %}
 
 %p 3000
@@ -121,14 +123,14 @@ E			[Ee][+-]?{D}+
 "with"			{ strcat(LineBuffer, yytext); return(WITH); }
 "->"			{ strcat(LineBuffer, yytext); return(REF); }
 
-{L}({L}|{D})*		{ strcat(LineBuffer, yytext); return(IDENTIFIER); }
+{L}({L}|{D})*		{ strcpy(identifier, yytext); strcat(LineBuffer, yytext); return(IDENTIFIER); }
 
-{D}+			{ strcat(LineBuffer, yytext); return(INTEGER); }
-{D}+{E}			{ strcat(LineBuffer, yytext); return(REAL); }
-{D}*"."{D}+({E})?	{ strcat(LineBuffer, yytext); return(REAL); }
-{D}+"."{D}*({E})?	{ strcat(LineBuffer, yytext); return(REAL); }
+{D}+			{ strcpy(constant, yytext); strcat(LineBuffer, yytext); return(INTEGER); }
+{D}+{E}			{ strcpy(constant, yytext); strcat(LineBuffer, yytext); return(REAL); }
+{D}*"."{D}+({E})?	{ strcpy(constant, yytext); strcat(LineBuffer, yytext); return(REAL); }
+{D}+"."{D}*({E})?	{ strcpy(constant, yytext); strcat(LineBuffer, yytext); return(REAL); }
 
-\"(\\.|[^\\"])*\"	{ strcat(LineBuffer, yytext); return(STRING); }
+\"(\\.|[^\\"])*\"	{ strcpy(constant, yytext); strcat(LineBuffer, yytext); return(STRING); }
 
 ":="			{ strcat(LineBuffer, yytext); return(ASSIGN); }
 "<="			{ strcat(LineBuffer, yytext); return(LE); }
diff --git a/SQLPSchema.y b/SQLPSchema.y
index 2486fd2f1554e647cfd5ba11aba6a702912909ce..54ee426c13c8c26b7709b9d4022a65c667f5a322 100644
--- a/SQLPSchema.y
+++ b/SQLPSchema.y
@@ -194,57 +194,57 @@ AttrPath
 Type
     : INTCLASS
     {
-        printf("INTCLASS is |%s|", yytext);
-        $$ = create_type(yytext);
+        printf("INTCLASS is |Integer|");
+        $$ = create_type("Integer");
     }
     | STRCLASS
     {
-        printf("STRCLASS is |%s|", yytext);
-        $$ = create_type(yytext);
+        printf("STRCLASS is |String|");
+        $$ = create_type("String");
     }
     | OID
     {
-        printf("OID is |%s|", yytext);
-        $$ = create_type(yytext);
+        printf("OID is |Oid|");
+        $$ = create_type("Oid");
     }
     ;
 
 AttributeIdentifier
     : IDENTIFIER
     {
-        printf("AttributeIdentifier is |%s| ", yytext);
-		$$ = create_attr(yytext);
+    	printf("AttributeIdentifier is |%s| ", identifier);
+			$$ = create_attr(identifier);
     }
     ;
 
 TableIdentifier
 	: IDENTIFIER
 	{
-		printf("|%s| ", yytext);
-		$$ = create_table(yytext);
+		printf("|%s| ", identifier);
+		$$ = create_table(identifier);
 	}
     ;
 
 VarIdentifier
 	: IDENTIFIER
 	{
-		printf("|%s| ", yytext);
-		$$ = create_var(yytext);
+		printf("|%s| ", identifier);
+		$$ = create_var(identifier);
 	}
     ;
 
 ReferringType
     : IDENTIFIER
     {
-        printf("ClassIdentifier is |%s| ", yytext);
-		$$ = create_rt(yytext);
+      printf("ClassIdentifier is |%s| ", identifier);
+			$$ = create_rt(identifier);
     }
     ;
 
 ClassIdentifier
     : IDENTIFIER
     {
-        printf("ClassIdentifier is |%s| ", yytext);
-		$$ = create_class(yytext);
+      printf("ClassIdentifier is |%s| ", identifier);
+			$$ = create_class(identifier);
     }
     ;