848 |
* issue (either a parser error or parser warning), a human readable |
* issue (either a parser error or parser warning), a human readable |
849 |
* explanation text of the error or warning and the location of the |
* explanation text of the error or warning and the location of the |
850 |
* encountered parser issue within the script. |
* encountered parser issue within the script. |
851 |
|
* |
852 |
|
* @see VMSourceToken for processing syntax highlighting instead. |
853 |
*/ |
*/ |
854 |
struct ParserIssue { |
struct ParserIssue { |
855 |
String txt; ///< Human readable explanation text of the parser issue. |
String txt; ///< Human readable explanation text of the parser issue. |
968 |
* This class is not actually used by the sampler itself. It is rather |
* This class is not actually used by the sampler itself. It is rather |
969 |
* provided for external script editor applications. Primary purpose of |
* provided for external script editor applications. Primary purpose of |
970 |
* this class is syntax highlighting for external script editors. |
* this class is syntax highlighting for external script editors. |
971 |
|
* |
972 |
|
* @see ParserIssue for processing compile errors and warnings instead. |
973 |
*/ |
*/ |
974 |
class VMSourceToken { |
class VMSourceToken { |
975 |
public: |
public: |
982 |
String text() const; |
String text() const; |
983 |
|
|
984 |
// position of token in script |
// position of token in script |
985 |
int firstLine() const; ///< First line this source token is located at in script source code (indexed with 0 being the very first line). |
int firstLine() const; ///< First line this source token is located at in script source code (indexed with 0 being the very first line). Most source code tokens are not spanning over multiple lines, the only current exception are comments, in the latter case you need to process text() to get the last line and last column for the comment. |
986 |
int firstColumn() const; ///< Last line this source token is located at in script source code. |
int firstColumn() const; ///< First column on the first line this source token is located at in script source code (indexed with 0 being the very first column). To get the length of this token use text().length(). |
987 |
|
|
988 |
// base types |
// base types |
989 |
bool isEOF() const; |
bool isEOF() const; ///< Returns true in case this source token represents the end of the source code file. |
990 |
bool isNewLine() const; |
bool isNewLine() const; ///< Returns true in case this source token represents a line feed character (i.e. "\n" on Unix systems). |
991 |
bool isKeyword() const; |
bool isKeyword() const; ///< Returns true in case this source token represents a language keyword (i.e. "while", "function", "declare", "on", etc.). |
992 |
bool isVariableName() const; |
bool isVariableName() const; ///< Returns true in case this source token represents a variable name (i.e. "$someIntVariable", "%someArrayVariable", "\@someStringVariable"). @see isIntegerVariable(), isStringVariable(), isArrayVariable() for the precise variable type. |
993 |
bool isIdentifier() const; |
bool isIdentifier() const; ///< Returns true in case this source token represents an identifier, which currently always means a function name. |
994 |
bool isNumberLiteral() const; |
bool isNumberLiteral() const; ///< Returns true in case this source token represents a number literal (i.e. 123). |
995 |
bool isStringLiteral() const; |
bool isStringLiteral() const; ///< Returns true in case this source token represents a string literal (i.e. "Some text"). |
996 |
bool isComment() const; |
bool isComment() const; ///< Returns true in case this source token represents a source code comment. |
997 |
bool isPreprocessor() const; |
bool isPreprocessor() const; ///< Returns true in case this source token represents a preprocessor statement. |
998 |
bool isOther() const; |
bool isOther() const; ///< Returns true in case this source token represents anything else not covered by the token types mentioned above. |
999 |
|
|
1000 |
// extended types |
// extended types |
1001 |
bool isIntegerVariable() const; |
bool isIntegerVariable() const; ///< Returns true in case this source token represents an integer variable name (i.e. "$someIntVariable"). |
1002 |
bool isStringVariable() const; |
bool isStringVariable() const; ///< Returns true in case this source token represents an string variable name (i.e. "\@someStringVariable"). |
1003 |
bool isArrayVariable() const; |
bool isArrayVariable() const; ///< Returns true in case this source token represents an array variable name (i.e. "%someArryVariable"). |
1004 |
bool isEventHandlerName() const; |
bool isEventHandlerName() const; ///< Returns true in case this source token represents an event handler name (i.e. "note", "release", "controller"). |
1005 |
|
|
1006 |
VMSourceToken& operator=(const VMSourceToken& other); |
VMSourceToken& operator=(const VMSourceToken& other); |
1007 |
|
|