|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.syntax.TokenizerImpl
org.millscript.millscript.syntax.ConfigurationParserImpl
public class ConfigurationParserImpl
This class implements the MillScript parser for use with configuration
files. As such it is actually the complete parser implementation but it
excludes nearly all syntax entries. The only syntax this parser understands
is "(", "," and ")".
| Field Summary |
|---|
| Fields inherited from class org.millscript.millscript.syntax.TokenizerImpl |
|---|
config, interpolationMap |
| Fields inherited from interface org.millscript.millscript.syntax.Parser |
|---|
ARITH_PREC, COMMA_PREC, COMMA_PREC1, LOW_PREC, NOT_PREC, RELOP_PREC, TIGHT_PREC |
| Constructor Summary | |
|---|---|
ConfigurationParserImpl(java.lang.String origin,
java.io.Reader r,
boolean eolc,
Configuration c)
Constructs a new ParserImpl with the specified origin, source,
interactive prompt and end of line comment status. |
|
| Method Summary | |
|---|---|
NameExpr |
getEnclosingClass()
Returns the enclosing class for this parser. |
Expr |
makeInterpolatedExpr()
Returns the current string, as an application of the format function with the current interpolation map values as arguments. |
protected static void |
put(java.lang.String s,
Syntax t)
Convenience method for inserting entries in the symbol table. |
java.lang.String |
readAttributeName()
Reads the next token from the source as an attribute name and returns it. |
Expr |
readBlock()
Reads a sequence of expressions from the source as a Block. |
Expr |
readBlockTo(java.lang.String sym)
Reads a sequence of expressions, followed by the specified symbol, from the source as a Block. |
Expr |
readExpr()
Reads the next expression from the source. |
Expr |
readExprComma()
Reads the next expression from the source at the COMMA_PREC1 precedence level. |
Expr |
readExprPrec(int prec)
Reads the next expression from the source at the specified precedence level. |
Expr |
readExprTo(java.lang.String sym)
Reads the next expression from the source, which must be followed by the specified symbol. |
NameExpr |
readName()
Reads the next token from the source as a name and returns a name expression for it. |
Expr |
readOptExpr()
Reads the optional next expression from the source. |
Expr |
readOptExprPrec(int prec)
Reads the optional next expression from the source at the specified precedence level. |
Expr |
readOptPrimary()
Reads the next token from the source as the optional primary expression in a potential sequence of expressions. |
Expr |
readPrimary()
Reads the next token from the source as the primary expression in a potential sequence of expressions. |
Expr |
readStmnts()
Reads a sequence of expressions from the source. |
Expr |
readStmntsTo(java.lang.String sym)
Reads a sequence of expressions from the source, which must be followed by the specified symbol. |
java.lang.String |
readSymbol()
Reads the next token from the source as a symbol and returns it. |
java.lang.String |
readTagName()
Reads the next token from the source as a tag name and returns it. |
| Methods inherited from class org.millscript.millscript.syntax.TokenizerImpl |
|---|
checkWhere, dropToken, getAttributeName, getErrorString, getInt, getLineNumber, getName, getOrigin, getQuoteChar, getString, getStringNoQuotes, getStringNoQuotes, getTagName, makePattern, markReader, mustRead, nextToken, peekRead, peekToken, resetReader, setContext, setLineNumber, setOrigin, setWhere, tryRead |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.millscript.millscript.syntax.Tokenizer |
|---|
checkWhere, dropToken, getAttributeName, getErrorString, getInt, getLineNumber, getName, getOrigin, getQuoteChar, getString, getStringNoQuotes, getStringNoQuotes, getTagName, makePattern, markReader, mustRead, nextToken, peekRead, peekToken, resetReader, setWhere, tryRead |
| Methods inherited from interface org.millscript.commons.alert.AlertOrigin |
|---|
setContext, setLineNumber, setOrigin |
| Constructor Detail |
|---|
public ConfigurationParserImpl(java.lang.String origin,
java.io.Reader r,
boolean eolc,
Configuration c)
ParserImpl with the specified origin, source,
interactive prompt and end of line comment status.
origin - the origin message for this tokenizerr - the character source to tokenizeeolc - flag indicating if end of line comments are supportedc - the configuration| Method Detail |
|---|
public NameExpr getEnclosingClass()
Parser
getEnclosingClass in interface ParserParser.getEnclosingClass()public Expr makeInterpolatedExpr()
Parser
makeInterpolatedExpr in interface ParserParser.makeInterpolatedExpr()
protected static void put(java.lang.String s,
Syntax t)
s - symbolt - Syntax for symbolpublic java.lang.String readAttributeName()
Parser
readAttributeName in interface ParserParser.readAttributeName()public Expr readBlock()
Parser
readBlock in interface ParserParser.readBlock()public Expr readBlockTo(java.lang.String sym)
Parser
readBlockTo in interface Parsersym - the symbol which must follow the block
Parser.readBlockTo(java.lang.String)public Expr readExpr()
Parser
readExpr in interface ParserParser.readExpr()public Expr readExprComma()
ParserCOMMA_PREC1 precedence level. Hence this will read up to
the next comma.
readExprComma in interface ParserParser.readExprComma()public Expr readExprPrec(int prec)
Parser
readExprPrec in interface Parserprec - the precedence level to read the next expression at
Parser.readExprPrec(int)public Expr readExprTo(java.lang.String sym)
Parser
readExprTo in interface Parsersym - the symbol which must follow the expression
Parser.readExprTo(java.lang.String)public NameExpr readName()
Parser
readName in interface ParserParser.readName()public Expr readOptExpr()
Parser
readOptExpr in interface ParserParser.readOptExpr()public Expr readOptExprPrec(int prec)
Parser
readOptExprPrec in interface Parserprec - the precedence level to read the next expression at
Parser.readOptExprPrec(int)public Expr readOptPrimary()
Parser
readOptPrimary in interface ParserParser.readOptPrimary()public Expr readPrimary()
Parser
readPrimary in interface ParserParser.readPrimary()public Expr readStmnts()
Parser
readStmnts in interface ParserParser.readStmnts()public Expr readStmntsTo(java.lang.String sym)
Parser
readStmntsTo in interface Parsersym - the symbol which must follow the statements
Parser.readStmntsTo(java.lang.String)public java.lang.String readSymbol()
Parser
readSymbol in interface ParserParser.readSymbol()public java.lang.String readTagName()
Parser
readTagName in interface ParserParser.readTagName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||