|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.quasiliteral.syntax.BaseLexer | +--org.quasiliteral.term.TermLexer
Untamed: Breaks textually input into a stream of tokens according to the Term language's defined grammar.
Field Summary |
Fields inherited from class org.quasiliteral.syntax.BaseLexer |
myBuilder, myChar, myContinueCount, myDelayedNextChar, myIndenter, myLData, myLTwine, myNoTabsFlag, myOptStartPos, myOptStartText, myPos, myQuasiFlag |
Fields inherited from interface org.quasiliteral.syntax.LexerFace |
EOFCHAR, EOFTOK |
Fields inherited from interface org.erights.e.elib.serial.PassByProxy |
HONORARY, HONORED_NAMES |
Constructor Summary | |
TermLexer(LineFeeder input,
boolean partialFlag,
boolean quasiFlag,
boolean noTabsFlag)
Enabled: |
|
TermLexer(LineFeeder input,
boolean partialFlag,
boolean quasiFlag,
boolean noTabsFlag,
AstroBuilder builder)
Enabled: |
Method Summary | |
protected Astro |
getNextToken()
|
protected boolean |
isRestBlank(int start)
Consider '#' and '//' comments to be blank as well. |
static boolean |
isSegPart(char c)
Enabled: Any character that may be a part of
a Java identifier, or a '.' or '-'. |
static boolean |
isSegStart(char c)
Enabled: Any character that may start
a Java identifier. |
static void |
main(String[] args)
Enabled: Just for testing. |
static TermLexer |
make(Twine sourceCode,
boolean quasiFlag,
boolean noTabsFlag)
Enabled: @param sourceCode The source code itself |
private Astro |
tag()
A tag is a sequence of tag-segments separated by colons. |
Methods inherited from class org.quasiliteral.syntax.BaseLexer |
charConstant, charLiteral, closeBracket, composite, docComment, endSpan, endToken, isEndOfFile, isJavaIdPart, isJavaIdStart, isWhite, leafEOL, leafTag, needMore, nextChar, nextToken, nextTopLevelUnit, numberLiteral, openBracket, openBracket, peekChar, peekChar, reset, setSource, skipLine, skipWhiteSpace, startToken, stopToken, stringLiteral, syntaxError, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TermLexer(LineFeeder input, boolean partialFlag, boolean quasiFlag, boolean noTabsFlag) throws IOException
public TermLexer(LineFeeder input, boolean partialFlag, boolean quasiFlag, boolean noTabsFlag, AstroBuilder builder) throws IOException
Method Detail |
public static TermLexer make(Twine sourceCode, boolean quasiFlag, boolean noTabsFlag) throws IOException
quasiFlag
- Should doubled @ and $ be collapsed to singles?noTabsFlag
- Should tabs be rejected as valid whitespace?
Assumed to correspond to the e.enable.notabs
property.
IOException
protected boolean isRestBlank(int start)
isRestBlank
in class BaseLexer
protected Astro getNextToken() throws IOException, SyntaxException
getNextToken
in class BaseLexer
IOException
SyntaxException
public static boolean isSegStart(char c)
start
a Java identifier.
Note that a Java identifier may start with a '_' or '$'.
This includes all the characters that may start an XML-NS-NCName as well as '$'.
This also includes all the characters that may start a Java or E fully qualified name.
public static boolean isSegPart(char c)
be a part of
a Java identifier, or a '.' or '-'.
Note that a Java identifier may contain '_'s and '$'s.
Not yet dealt with are the XML CombiningChars or the XML Extenders, both of which should be included in isSegStart. Once these are included, then this will include all the characters that can be part of an XML-NS-NCNameChar as well as '$'.
This also includes all the characters that may be a part of a Java or E fully qualified name.
private Astro tag() throws IOException, SyntaxException
<tag> ::= <segment> (':' <segment>)* <segment> ::= <segStart> <segPart>* | '.' <segStart> <segPart>* | '<' <uric>* '>'Because of the second segment production, a segment may also begin with a '.', though neither an XML-NS-NCName nor a Java or E fully qualified name may begin with a '.'. Therefore, names that begin with a '.' (like ".bag.") can be used in a keyword-like way without conflicting with these other namespaces. Out of Fortran nostalgia, by convention such names end with a '.' as well.
IOException
SyntaxException
public static void main(String[] args) throws IOException, SyntaxException
IOException
SyntaxException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |