Merged with master and resolved conflicts

master
Sanjar Ahmadov 4 years ago
commit 7688ac7a8d

@ -259,7 +259,7 @@ non terminal VarDef var_def;
non terminal ClassDef class_def;
non terminal FuncDef fun_def;
non terminal Literal literal;
non terminal StringLiteral bin_op, comp_op;
non terminal StringLiteral bin_op, comp_op;
non terminal TypedVar typed_var;
non terminal TypeAnnotation type, ret_type;
non terminal Identifier identifier;

@ -2,6 +2,7 @@ package chocopy.pa1;
import java_cup.runtime.*;
import java.util.ArrayList;
import java.util.Iterator;
%%
/*** Do not change the flags below unless you know what you are doing. ***/
@ -81,6 +82,7 @@ import java.util.Iterator;
WhiteSpace = [ \t]
LineBreak = \r|\n|\r\n
IntegerLiteral = 0|[1-9][0-9]* // Accroding to the manual, 00+ is illeagal
StringLiteral = ([^\"\\]|(\\\")|(\\t)|(\\r)|(\\n)|(\\\\))+ // \n, \r, \t, \\, \" and Anything except \ and "
Identifiers = (_|[a-z]|[A-Z])(_|[a-z]|[A-Z]|[0-9])*
@ -188,6 +190,7 @@ if True:
/* Literals. */
{IntegerLiteral} { return symbol(ChocoPyTokens.NUMBER,
Integer.parseInt(yytext())); }
"\"" {yybegin(STR); str_l = yyline + 1; str_c = yycolumn + 1; currString = "";} //Start taking a string when see a "
"False" { return symbol(ChocoPyTokens.BOOL, false); }
"True" { return symbol(ChocoPyTokens.BOOL, true); }

Loading…
Cancel
Save