private class ConfigurationFile.Parser extends Object
Modifier and Type | Field and Description |
---|---|
private StreamTokenizer |
st
The tokenizer to use for parsing
|
Constructor and Description |
---|
ConfigurationFile.Parser(Reader reader,
String[] options)
Adds the imports and entries parsed from the specified input stream,
as well as overrides parsed from the specified options, starting
with the second element.
|
Modifier and Type | Method and Description |
---|---|
private void |
createTokenizer(Reader reader)
Creates and sets the tokenizer using the specified reader.
|
private String |
describeCurrentToken()
Returns a String that describes the current token.
|
private ConfigurationFile.Literal |
getNumber(String val)
Parses a numeric literal and returns the value as a Literal.
|
private void |
oops(String what)
Throws a ConfigurationException for an error described by the what
argument.
|
private ConfigurationFile.ParseNode[] |
parseArgs(ConfigurationFile.Entry inEntry,
char close)
Parses an ExprList and the trailing token specified by close.
|
private void |
parseComponent(String component)
Parses a Component.
|
private void |
parseEntry(String component,
String name)
Parses an Entry.
|
(package private) ConfigurationFile.ParseNode |
parseExpr(ConfigurationFile.Entry inEntry)
Parses a string concatenation
|
private void |
parseImport()
Parses an Import, updating classImports and onDemandImports.
|
private ConfigurationFile.MethodCall |
parseMethodCall(ConfigurationFile.Entry inEntry,
String name)
Resolves a static method call and returns a MethodCall instance that
describes the method and arguments for the call.
|
private ConfigurationFile.ParseNode |
parseNewInstance(ConfigurationFile.Entry inEntry)
Parses a NewExpr except for the leading "new", and returns the
constructed object.
|
private void |
parseOverride()
Parses an Override .
|
private void |
parseSource()
Parses imports and components from the source, and stores the
results.
|
(package private) ConfigurationFile.ParseNode |
parseSubExpr(ConfigurationFile.Entry inEntry)
Parses an Expr.
|
private void |
syntax(String what)
Throws a ConfigurationException for a syntax error described by the
what argument.
|
private void |
token(char c)
Parses the next token from the stream, and generates a syntax error
if the token does not equal the specified character.
|
private String |
token(String what)
Parses the next token from the stream, and generates a syntax error
if the token is not a TT_WORD.
|
private StreamTokenizer st
ConfigurationFile.Parser(Reader reader, String[] options) throws ConfigurationException
ConfigurationException
private void createTokenizer(Reader reader)
private void parseSource() throws ConfigurationException, IOException
ConfigurationException
IOException
private void parseImport() throws ConfigurationException, IOException
ConfigurationException
IOException
private void parseComponent(String component) throws ConfigurationException, IOException
ConfigurationException
IOException
private void parseEntry(String component, String name) throws ConfigurationException, IOException
ConfigurationException
IOException
private void parseOverride() throws ConfigurationException, IOException
ConfigurationException
IOException
private ConfigurationFile.ParseNode[] parseArgs(ConfigurationFile.Entry inEntry, char close) throws ConfigurationException, IOException
ConfigurationException
IOException
ConfigurationFile.ParseNode parseExpr(ConfigurationFile.Entry inEntry) throws ConfigurationException, IOException
ConfigurationException
IOException
ConfigurationFile.ParseNode parseSubExpr(ConfigurationFile.Entry inEntry) throws ConfigurationException, IOException
ConfigurationException
IOException
private ConfigurationFile.Literal getNumber(String val) throws ConfigurationException, IOException
ConfigurationException
IOException
private ConfigurationFile.ParseNode parseNewInstance(ConfigurationFile.Entry inEntry) throws ConfigurationException, IOException
ConfigurationException
IOException
private ConfigurationFile.MethodCall parseMethodCall(ConfigurationFile.Entry inEntry, String name) throws ConfigurationException, IOException
ConfigurationException
IOException
private void token(char c) throws ConfigurationException, IOException
ConfigurationException
IOException
private String token(String what) throws ConfigurationException, IOException
ConfigurationException
IOException
private void syntax(String what) throws ConfigurationException
ConfigurationException
private String describeCurrentToken()
private void oops(String what) throws ConfigurationException
ConfigurationException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.