45872bfa8b5701e2da983a5052c9f5c18c661621 kent Thu Dec 9 12:54:18 2021 -0800 Adding option for tokenizer to handle a pretty good spectrum of two character operations. diff --git src/inc/tokenizer.h src/inc/tokenizer.h index 15623a4..f34512a 100644 --- src/inc/tokenizer.h +++ src/inc/tokenizer.h @@ -11,30 +11,31 @@ { bool reuse; /* True if want to reuse this token. */ bool eof; /* True at end of file. */ int leadingSpaces; /* Number of leading spaces before token. */ struct lineFile *lf; /* Underlying file. */ char *curLine; /* Current line of text. */ char *linePt; /* Start position within current line. */ char *string; /* String value of token */ int sSize; /* Size of string. */ int sAlloc; /* Allocated string size. */ /* Some variables set after tokenizerNew to control details of * parsing. */ bool leaveQuotes; /* Leave quotes in string. */ bool uncommentC; /* Take out C (and C++) style comments. */ bool uncommentShell; /* Take out # style comments. */ + bool twoCharOps; /* Return single token for != == && || >= <= ++ -- */ }; struct tokenizer *tokenizerNew(char *fileName); /* Return a new tokenizer. */ struct tokenizer *tokenizerOnLineFile(struct lineFile *lf); /* Create a new tokenizer on open lineFile. */ void tokenizerFree(struct tokenizer **pTkz); /* Tear down a tokenizer. */ void tokenizerReuse(struct tokenizer *tkz); /* Reuse token. */ int tokenizerLineCount(struct tokenizer *tkz);