b-frechette / C-S20

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

Invalid CHARCONST Matching #18

Closed b-frechette closed 4 years ago

b-frechette commented 4 years ago

Currently for matching an invalid CHARCONST I am matching any CHARCONST that is over the limit of characters (that still does not include an unmatched single quote or a new line in it). I then parse through the input to get the number of invalid characters that was produced and make sure that all meta-characters are handled so that if there is a case such as: '\char' it would in the token part -- not the error part return something like this: Line 1 Token: CHARCONST Value: 'c' Input: '\char'

I have emailed Heckendorn about this, although I don't believe I was too clear and may have to clarify tomorrow when I email about matching the error message that comes above this printout statement.

b-frechette commented 4 years ago

I got an email back from Heckendorn, he confirmed that indeed the error acts more of a warning than it does an explicit error, he noted that he might update this in the next assignment.

He seemed to agree in the email that since it handled more like an error (and might be explicitly switched to one) than the way that I handle potential cases with meta-characters being the first one and still handling CHARCONST rules beyond the invalidness of more than a single character.