Top  Previous  Next

Scripts > Class elements and c++ instructions > Events


There is a number of functions which are always called automatically when a certain event appears. In these functions nothing happens as long as a corresponding event handling wasn't programmed explicitly. The first step, to do this is, to insert such a function by the pop-up menu of the list on the element page:






In contrast to the functions of the TetraComponents of the same name no explicit parameters are passed in these functions. Like in all TETRA functions, there is, however, the implicit xState parameter, by which you can access all properties of the parser-state





The event OnEnterProduction occurs, when the parser branchs into a production




The event OnExitProduction occurs, when the parser leaves a production.




The event OnAcceptToken occurs, if a token recognized by the scanner is found and accepted in the grammar. This happens in the debugger at the moment where a terminal node is left.




The event OnBeginBranch occurs, when the parser enters an option or a repeat.




The event OnEndBranch occurs, when the parser leaves the option or a repeat.




The event OnBeginDocument occurs, when the parser begins with a new input.




The event OnEndDocument occurs, when the parser finishs parsing a file or a string.




The event OnParseError occurs before the parsing is aborted with an error message. Sometimes the abort can be prevented, if the error can be recovered here. Otherwise you have the chance in OnParseError to create some additional report about the circumstances of the error.



This page belongs to the TextTransformer Documentation

Home  Content  German