667 |
*/ |
*/ |
668 |
struct ParserIssue { |
struct ParserIssue { |
669 |
String txt; ///< Human readable explanation text of the parser issue. |
String txt; ///< Human readable explanation text of the parser issue. |
670 |
int line; ///< Line number within the script where this issue was encountered. |
int firstLine; ///< The first line number within the script where this issue was encountered (indexed with 1 being the very first line). |
671 |
int column; ///< Column within the script where this issue was encountered. |
int lastLine; ///< The last line number within the script where this issue was encountered. |
672 |
|
int firstColumn; ///< The first column within the script where this issue was encountered (indexed with 1 being the very first column). |
673 |
|
int lastColumn; ///< The last column within the script where this issue was encountered. |
674 |
ParserIssueType_t type; ///< Whether this issue is either a parser error or just a parser warning. |
ParserIssueType_t type; ///< Whether this issue is either a parser error or just a parser warning. |
675 |
|
|
676 |
/** |
/** |
679 |
inline void dump() { |
inline void dump() { |
680 |
switch (type) { |
switch (type) { |
681 |
case PARSER_ERROR: |
case PARSER_ERROR: |
682 |
printf("[ERROR] line %d, column %d: %s\n", line, column, txt.c_str()); |
printf("[ERROR] line %d, column %d: %s\n", firstLine, firstColumn, txt.c_str()); |
683 |
break; |
break; |
684 |
case PARSER_WARNING: |
case PARSER_WARNING: |
685 |
printf("[Warning] line %d, column %d: %s\n", line, column, txt.c_str()); |
printf("[Warning] line %d, column %d: %s\n", firstLine, firstColumn, txt.c_str()); |
686 |
break; |
break; |
687 |
} |
} |
688 |
} |
} |
794 |
String text() const; |
String text() const; |
795 |
|
|
796 |
// position of token in script |
// position of token in script |
797 |
int firstLine() const; |
int firstLine() const; ///< First line this source token is located at in script source code (indexed with 0 being the very first line). |
798 |
int firstColumn() const; |
int firstColumn() const; ///< Last line this source token is located at in script source code. |
799 |
|
|
800 |
// base types |
// base types |
801 |
bool isEOF() const; |
bool isEOF() const; |