frysk.expr
Class FQIdentParser

java.lang.Object
  extended by 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.


Nested Class Summary
static class FQIdentParser.ExtraGarbageException
           
static class FQIdentParser.FQIdentException
           
static class FQIdentParser.InvalidTokenException
           
 
Method Summary
static boolean isGlobChar(char c)
           
static boolean isWildcardPattern(String str)
           
 FQIdentToken parse(String initial)
           
static FQIdentifier parseFQIdentifier(String str, boolean allowDynamic, boolean allowGlobs, boolean expectMoreTokens)
           
static FQIdentifier parseFtraceIdentifier(String str)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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