|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hecl.Parse
public class Parse
The Parse
class takes care of parsing Hecl scripts.
Field Summary | |
---|---|
protected static char[] |
eol
|
protected java.lang.String |
in
|
protected Interp |
interp
|
protected StringThing |
outBuf
|
protected boolean |
outBufNumeric
|
protected boolean |
outBufused
|
protected java.util.Vector |
outGroup
|
protected java.util.Vector |
outList
|
protected boolean |
parselist
|
protected ParseState |
state
|
Constructor Summary | |
---|---|
Parse()
Creates a new Parse instance. |
|
Parse(Interp interp_in,
java.lang.String in_in)
Creates a new Parse instance. |
Method Summary | |
---|---|
protected void |
addCommand()
The addCommand method adds a command to the current
output. |
protected void |
addCurrent()
The addCurrent method adds a new element to the command
parsed. |
void |
addDollar()
The addDollar method adds a $var lookup to the current
output. |
void |
addSub(int type)
|
protected void |
appendToCurrent(char ch)
The appendToCurrent method adds a character to the group
object. |
boolean |
more()
The more method returns a boolean value indicating whether
there is more text to be parsed or not. |
protected void |
newCurrent()
The newCurrent method creates a new 'context' to
be added to. |
java.util.Vector |
parse()
The parse method runs the parser on the text added by
creating a new Parse instance. |
protected void |
parseBlock(ParseState state)
parseBlock parses a {} block. |
protected void |
parseBlockOrCommand(ParseState state,
boolean block,
boolean invar)
parseBlockOrCommand is what parseCommand and parseBlock
use internally. |
protected void |
parseCommand(ParseState state)
parseCommand parses a [] command. |
protected boolean |
parseEscape(ParseState state)
The parseEscape method parses \n \t style escapes
- or just prints the next character. |
void |
parseLine(ParseState state)
The parseLine method is where parsing starts on a new
line. |
protected void |
parseText(ParseState state)
parseText parses a "string in quotes". |
CodeThing |
parseToCode()
parseToCode parses up a [] section as code. |
protected void |
parseVarBlock(ParseState state)
|
protected void |
parseWord(ParseState state)
parseWord parses a regular word not in quotes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector outList
protected ParseState state
protected Interp interp
protected java.lang.String in
protected StringThing outBuf
protected boolean outBufNumeric
protected boolean outBufused
protected java.util.Vector outGroup
protected boolean parselist
protected static final char[] eol
Constructor Detail |
---|
public Parse()
Parse
instance. Not actually used by
anything.
public Parse(Interp interp_in, java.lang.String in_in)
Parse
instance.
interp_in
- a Interp
valuein_in
- a String
valueMethod Detail |
---|
public boolean more()
more
method returns a boolean value indicating whether
there is more text to be parsed or not.
boolean
valuepublic java.util.Vector parse() throws HeclException
parse
method runs the parser on the text added by
creating a new Parse instance.
Vector
value
HeclException
- if an error occurspublic CodeThing parseToCode() throws HeclException
parseToCode
parses up a [] section as code.
CodeThing
value
HeclException
- if an error occursprotected void newCurrent() throws HeclException
newCurrent
method creates a new 'context' to
be added to.
HeclException
- if an error occursprotected void addCurrent() throws HeclException
addCurrent
method adds a new element to the command
parsed.
HeclException
protected void appendToCurrent(char ch) throws HeclException
appendToCurrent
method adds a character to the group
object.
ch
- a char
HeclException
protected void addCommand() throws HeclException
addCommand
method adds a command to the current
output.
HeclException
- if an error occurspublic void addDollar() throws HeclException
addDollar
method adds a $var lookup to the current
output.
HeclException
- if an error occurspublic void addSub(int type) throws HeclException
HeclException
public void parseLine(ParseState state) throws HeclException
parseLine
method is where parsing starts on a new
line.
state
- a ParseState
value
HeclException
- if an error occursprotected void parseBlock(ParseState state) throws HeclException
parseBlock
parses a {} block.
state
- a ParseState
value
HeclException
- if an error occursprotected void parseVarBlock(ParseState state) throws HeclException
HeclException
protected void parseCommand(ParseState state) throws HeclException
parseCommand
parses a [] command.
state
- a ParseState
value
HeclException
- if an error occursprotected void parseBlockOrCommand(ParseState state, boolean block, boolean invar) throws HeclException
parseBlockOrCommand
is what parseCommand and parseBlock
use internally.
state
- a ParseState
valueblock
- a boolean
value
HeclException
- if an error occursprotected void parseText(ParseState state) throws HeclException
parseText
parses a "string in quotes".
state
- a ParseState
value
HeclException
- if an error occursprotected void parseWord(ParseState state) throws HeclException
parseWord
parses a regular word not in quotes.
state
- a ParseState
value
HeclException
- if an error occursprotected boolean parseEscape(ParseState state) throws HeclException
parseEscape
method parses \n \t style escapes
- or just prints the next character.
state
- a ParseState
value
boolean
value
HeclException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |