Merge pull request #12 from UB-CSE443/Sprint1-TokenLocationLogic-NoTask

Sprint1 token location logic no task
This commit is contained in:
Moroseui
2025-02-13 20:28:29 -05:00
committed by GitHub
7 changed files with 94 additions and 21 deletions

View File

@ -8,13 +8,15 @@
#include <stdbool.h>
#include "typedefs.h"
int line_number = 1, column_number = 1;
bool DEBUG = true;
#ifndef DEBUG
#define DEBUG 0
#endif
%}
COM ([^*]|\*+[^)*])*
ID [A-Za-z_][0-9A-Za-z_]*
DIGIT [0-9]
CHAR \\n|\\t|\\'|[^'\n\t\\]
CHAR \\n|\\t|\\'|[^'\n\t\\]|\\\\
/* char can be a newline, tab, an escaped quote, or anything but a single quote, an actual line break, an actual tab, or a backslash by itself (to prevent confusion from escaped quote */
SCHAR \\n|\\t|\\\"|[^\"\n\\]
/* similar to above, a string Char (SCHAR) is the same as a CHAR except we cannot have double quotes instead of single quotes. Double quotes need to be escaped in Flex unlike single quotes based on documentation */