b-frechette / C-S20

University of Idaho CS 445 compiler for the C- (Version S20) language.
2 stars 0 forks source link

Fix STRINGCONST #12

Closed b-frechette closed 4 years ago

b-frechette commented 4 years ago

The string const, as stated by Heckendorn on 01/28, the input will be the value from yytext(), the value will be parsed in the following way:

  1. In the string const all the meta-characters must be correctly stored as their chars, including that of \n and \0, need to check the example output on the needs of \t.

  2. For the single quotes around the parsed value Heckendorn stated that he put those in the print statement. So, it will look something like this, instead of doing that while parsing out the meta-characters: printf("Value: '%s'", $1->stringValue);

Output should look like: Line 1 Toke: STRINGCONST Value: 'dog' Input: "dog"

b-frechette commented 4 years ago

This is at the moment is solved, currently waiting back for #13 word from Heckendorn, but at the moment the regular expression for STRINGCONST is as follows: \"(\\.|[^"\n])*\" ensuring that there is an error with an unescaped " beyond the ending one.

b-frechette commented 4 years ago

This solution is being considered solved, I tested it against the most recent fix and test cases with the homework server and it matched all of them perfectly.