767 |
virtual VMEventHandler* eventHandlerByName(const String& name) = 0; |
virtual VMEventHandler* eventHandlerByName(const String& name) = 0; |
768 |
}; |
}; |
769 |
|
|
770 |
|
class SourceToken; |
771 |
|
|
772 |
|
/** @brief Recognized token of a script's source code. |
773 |
|
* |
774 |
|
* Represents one recognized token of a script's source code, for example |
775 |
|
* a keyword, variable name, etc. and it provides further informations about |
776 |
|
* that particular token, i.e. the precise location (line and column) of the |
777 |
|
* token within the original script's source code. |
778 |
|
* |
779 |
|
* This class is not actually used by the sampler itself. It is rather |
780 |
|
* provided for external script editor applications. Primary purpose of |
781 |
|
* this class is syntax highlighting for external script editors. |
782 |
|
*/ |
783 |
|
class VMSourceToken { |
784 |
|
public: |
785 |
|
VMSourceToken(); |
786 |
|
VMSourceToken(SourceToken* ct); |
787 |
|
VMSourceToken(const VMSourceToken& other); |
788 |
|
virtual ~VMSourceToken(); |
789 |
|
|
790 |
|
// original text of this token as it is in the script's source code |
791 |
|
String text() const; |
792 |
|
|
793 |
|
// position of token in script |
794 |
|
int firstLine() const; |
795 |
|
int firstColumn() const; |
796 |
|
|
797 |
|
// base types |
798 |
|
bool isEOF() const; |
799 |
|
bool isNewLine() const; |
800 |
|
bool isKeyword() const; |
801 |
|
bool isVariableName() const; |
802 |
|
bool isIdentifier() const; |
803 |
|
bool isNumberLiteral() const; |
804 |
|
bool isStringLiteral() const; |
805 |
|
bool isComment() const; |
806 |
|
bool isPreprocessor() const; |
807 |
|
bool isOther() const; |
808 |
|
|
809 |
|
// extended types |
810 |
|
bool isIntegerVariable() const; |
811 |
|
bool isStringVariable() const; |
812 |
|
bool isArrayVariable() const; |
813 |
|
bool isEventHandlerName() const; |
814 |
|
|
815 |
|
VMSourceToken& operator=(const VMSourceToken& other); |
816 |
|
|
817 |
|
private: |
818 |
|
SourceToken* m_token; |
819 |
|
}; |
820 |
|
|
821 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |
822 |
|
|
823 |
#endif // LS_INSTR_SCRIPT_PARSER_COMMON_H |
#endif // LS_INSTR_SCRIPT_PARSER_COMMON_H |