Class TerminalConsumer
- java.lang.Object
-
- org.eclipse.xtext.parser.packrat.consumers.AbstractConsumer
-
- org.eclipse.xtext.parser.packrat.consumers.TerminalConsumer
-
- All Implemented Interfaces:
ITerminalConsumer
- Direct Known Subclasses:
AbstractRuleAwareTerminalConsumer,EnumLiteralConsumer,KeywordConsumer
public abstract class TerminalConsumer extends AbstractConsumer implements ITerminalConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected intSUCCESS
-
Constructor Summary
Constructors Modifier Constructor Description protectedTerminalConsumer(ITerminalConsumerConfiguration configuration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intconsume()Scan the configured input source for a consumable terminal at the current offset.intconsume(java.lang.String feature, boolean isMany, boolean isBoolean, AbstractElement element, ISequenceMatcher notMatching, boolean optional)Scan the configured input source for a consumable terminal at the current offset.intconsume(ISequenceMatcher notMatching)Scan the configured input source for a consumable terminal at the current offset.protected AbstractParsedTokencreateParsedToken(java.lang.String feature, boolean isMany, boolean isBoolean, AbstractElement element, ISequenceMatcher notMatching, boolean optional, int prevMarker, IParsedTokenSource source)protected abstract intdoConsume()protected booleaneof()protected chargetChar()abstract org.eclipse.emf.ecore.EObjectgetGrammarElement()protected abstract java.lang.StringgetRuleName()protected voidincOffset()booleanisHidden()protected intmark()protected booleanpeekChar(ICharacterClass characterClass)protected booleanreadAnyChar(char... candidates)protected booleanreadAnyChars(char... candidates)protected booleanreadChar(char candidate)protected booleanreadChar(ICharacterClass characterClass)protected booleanreadCharBetween(char min, char max)protected booleanreadChars(char candidate)protected booleanreadChars(ICharacterClass characterClass)protected booleanreadCharsBetween(char min, char max)protected booleanreadString(java.lang.CharSequence seq)protected booleanreadUntil(java.lang.CharSequence seq)protected voidrollbackTo(int marker)voidsetHidden(boolean hidden)java.lang.StringtoString()-
Methods inherited from class org.eclipse.xtext.parser.packrat.consumers.AbstractConsumer
getInput, getOffset, getTokenAcceptor
-
-
-
-
Constructor Detail
-
TerminalConsumer
protected TerminalConsumer(ITerminalConsumerConfiguration configuration)
-
-
Method Detail
-
consume
public final int consume(java.lang.String feature, boolean isMany, boolean isBoolean, AbstractElement element, ISequenceMatcher notMatching, boolean optional)Description copied from interface:ITerminalConsumerScan the configured input source for a consumable terminal at the current offset. If it can be found, create a configured parsed token and increase the offset of the input.- Specified by:
consumein interfaceITerminalConsumer
-
createParsedToken
protected AbstractParsedToken createParsedToken(java.lang.String feature, boolean isMany, boolean isBoolean, AbstractElement element, ISequenceMatcher notMatching, boolean optional, int prevMarker, IParsedTokenSource source)
-
consume
public final int consume()
Description copied from interface:ITerminalConsumerScan the configured input source for a consumable terminal at the current offset. If it can be found, do nothing but increase the offset of the input.- Specified by:
consumein interfaceITerminalConsumer
-
consume
public final int consume(ISequenceMatcher notMatching)
Description copied from interface:ITerminalConsumerScan the configured input source for a consumable terminal at the current offset. If it can be found, do nothing but increase the offset of the input.- Specified by:
consumein interfaceITerminalConsumer
-
incOffset
protected void incOffset()
-
readAnyChar
protected boolean readAnyChar(char... candidates)
-
readChar
protected boolean readChar(char candidate)
-
readChar
protected boolean readChar(ICharacterClass characterClass)
-
getChar
protected char getChar()
-
peekChar
protected boolean peekChar(ICharacterClass characterClass)
-
readCharBetween
protected boolean readCharBetween(char min, char max)
-
readAnyChars
protected boolean readAnyChars(char... candidates)
-
readChars
protected boolean readChars(char candidate)
-
readChars
protected boolean readChars(ICharacterClass characterClass)
-
readCharsBetween
protected boolean readCharsBetween(char min, char max)
-
readString
protected boolean readString(java.lang.CharSequence seq)
-
readUntil
protected boolean readUntil(java.lang.CharSequence seq)
-
doConsume
protected abstract int doConsume()
-
getGrammarElement
public abstract org.eclipse.emf.ecore.EObject getGrammarElement()
-
getRuleName
protected abstract java.lang.String getRuleName()
-
setHidden
public void setHidden(boolean hidden)
- Specified by:
setHiddenin interfaceITerminalConsumer
-
isHidden
public boolean isHidden()
- Specified by:
isHiddenin interfaceITerminalConsumer
-
eof
protected boolean eof()
-
mark
protected int mark()
-
rollbackTo
protected void rollbackTo(int marker)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-