frysk.expr
Class FQIdentParser
java.lang.Object
frysk.expr.FQIdentParser
public class FQIdentParser
- extends Object
Funky HPD #-syntax doesn't map very well to LL-k type parser (for
constant 'k'). When written directly in antlr, we obviously get
lots of lexical ambiguities. We work around that by doing
arbitrary manual look-ahead and just parsing the tokens ourselves.
FQIdentParser is where that parsing takes place. Besides
supporting antlr lexical analyzer, the class can be used standalone
to parse arbitrary strings.
isGlobChar
public static boolean isGlobChar(char c)
isWildcardPattern
public static boolean isWildcardPattern(String str)
parse
public FQIdentToken parse(String initial)
throws RecognitionException,
CharStreamException,
TokenStreamException
- Parameters:
initial
- Portion of the character stream that is part of
the identifier, but was already consumed by lexer.
- Throws:
RecognitionException
CharStreamException
TokenStreamException
parseFQIdentifier
public static FQIdentifier parseFQIdentifier(String str,
boolean allowDynamic,
boolean allowGlobs,
boolean expectMoreTokens)
throws FQIdentParser.ExtraGarbageException,
FQIdentParser.InvalidTokenException
- Throws:
FQIdentParser.ExtraGarbageException
FQIdentParser.InvalidTokenException
parseFtraceIdentifier
public static FQIdentifier parseFtraceIdentifier(String str)
throws FQIdentParser.ExtraGarbageException,
FQIdentParser.InvalidTokenException
- Throws:
FQIdentParser.ExtraGarbageException
FQIdentParser.InvalidTokenException