Package eu.bandm.tools.d2d2.parser2
package eu.bandm.tools.d2d2.parser2
-
ClassDescriptionHand-written Ramus-based lexer and parser for d2d definition files.Enumeration of token types.TLex<D,
T> Item continuation Item action (TLex context) | ConsumeOrShift c char cset CharSet actionAfterTest(TLex context) | | Consume | | Shift | ChoiceOrState alternatives SEQ ConsumeOrShift other OPT Otherwise actionAfterTest(TLex context) | | Choise | | State | Other | CloseState | Append text OPT string | Deliver reduce OPT Function t TokenType | Text2Token fun BiFunction<String,Location,Tokentype> | Text2cont fun BiFunction<String,Location,Tokentype> | Error text StringTLex.Append<DD,TT> Append the given text or the last consumed character to TLex.outBufferTLex.Choice<DD,TT> Steps through all alternatives (which must be Consumes or Shifts) and calls their "test()" and "actionAfterText()" separately.TLex.ChoiceOrState<DD,TT> TLex.CloseState<DD,TT> TLex.Consume<DD,TT> If the test is positive (look-ahead char is equal to c or is in set cset) then consume this character = remove it from the input and get the next look-ahead.TLex.ConsumeOrShift<DD,TT> TLex.Deliver<DD,TT> Constructcs a token with the given type and the text accumulated in "TLex.outBuffer" and the location from "TLex.location()".Can be implemented by a token type to get a printable text.TLex.Error<DD,TT> Delivers a token with the error token type (as defined when constructing TLex) and the given type.TLex.Item<DD,TT> TLex.Other<DD,TT> Only a wrapper needed for the construction interface.TLex.Shift<DD,TT> If the test is positive (look-ahead char is equal to c or is in set cset) then append this character to the output buffer "Tlex.oputBuffer" and consume this character.TLex.State<DD,TT> Pushes itself onto the stateStack and the current input location to the locstack.TLex.Text2cont<DD,TT> Calculates the contiunation (=the following lexer code) from the vaue accumulated in the TLex.outBuffer.TLex.Text2token<DD,TT> Same as deliver, but not the token factory stord in TLex but the function is used for constructing the token.TLex.Token<D,T extends TLex.Displayable> A simple default implementation of Tokens.