|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.edugility.objexj.parser.Parser
public class Parser
A parser that consumes Token
s from a PostfixTokenizer
.
Constructor Summary | |
---|---|
Parser()
Creates a new Parser . |
Method Summary | ||
---|---|---|
|
parse(PostfixTokenizer tokenizer)
Receives a feed of Token s from the supplied PostfixTokenizer and parses them into a Program . |
|
|
parse(String input)
Constructs a new PostfixTokenizer and associated Reader machinery and then calls the parse(PostfixTokenizer) method and returns its result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Parser()
Parser
.
Method Detail |
---|
public <T> Program<T> parse(String input) throws IOException, ParseException
PostfixTokenizer
and associated Reader
machinery and then calls the parse(PostfixTokenizer)
method and returns its result.
T
- the type of Object
the resulting Program
will work withinput
- the String
representation of a Program
; must not be null
IllegalArgumentException
- if input
is null
IOException
- if the String
could not be read
ParseException
parse(PostfixTokenizer)
,
PostfixTokenizer
public <T> Program<T> parse(PostfixTokenizer tokenizer) throws ParseException
Token
s from the supplied PostfixTokenizer
and parses them into a Program
.
This method never returns null
.
T
- the type of Object
the returned Program
will be capable of matchingtokenizer
- the PostfixTokenizer
that provides a
token stream; must not be null
null
Program
IllegalArgumentException
- if tokenizer
is
null
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |