|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jga.parser.FunctorParser
public class FunctorParser
Parser that converts java-like expressions into functors.
Field Summary | |
---|---|
static java.lang.String[] |
ARG_NAME
|
Token |
jj_nt
|
boolean |
lookingAhead
|
Token |
token
|
FunctorParserTokenManager |
token_source
|
Fields inherited from interface net.sf.jga.parser.FunctorParserConstants |
---|
CHARACTER_LITERAL, DECIMAL_LITERAL, DEFAULT, DIGIT, EOF, EXPONENT, FALSE, FLOATING_POINT_LITERAL, HEX_LITERAL, IDENTIFIER, INTEGER_LITERAL, LETTER, LPAREN, NEW, NULL, OCTAL_LITERAL, STRING_LITERAL, tokenImage, TRUE |
Constructor Summary | |
---|---|
FunctorParser(FunctorParserTokenManager tm)
|
|
FunctorParser(java.io.InputStream stream)
|
|
FunctorParser(java.io.Reader stream)
|
Method Summary | |
---|---|
protected FunctorRef |
checkReservedNames(java.lang.String name)
Allows for functor names to be added to the grammar. |
java.lang.Class |
getReturnType()
Returns the type of object returned by the last functor parsed. |
BinaryFunctor |
parseBinary(java.lang.Class arg1Type,
java.lang.Class arg2Type)
Parses the current input to create a BinaryFunctor that takes arguments of the given types. |
BinaryFunctor |
parseBinary(java.lang.String str,
java.lang.Class arg1Type,
java.lang.Class arg2Type)
Parses the string to create a BinaryFunctor that takes arguments of the given types. |
Generator |
parseGenerator()
Parses the contents of the current input to create a Generator |
Generator |
parseGenerator(java.lang.String str)
Parses the string to create a Generator. |
UnaryFunctor |
parseUnary(java.lang.Class argType)
Parses the current input to create a UnaryFunctor that takes an argument of the given type. |
UnaryFunctor |
parseUnary(java.lang.String str,
java.lang.Class argType)
Parses the string to create a UnaryFunctor that takes an argument of the given type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] ARG_NAME
public FunctorParserTokenManager token_source
public Token token
public Token jj_nt
public boolean lookingAhead
Constructor Detail |
---|
public FunctorParser(java.io.InputStream stream)
public FunctorParser(java.io.Reader stream)
public FunctorParser(FunctorParserTokenManager tm)
Method Detail |
---|
public static void main(java.lang.String[] args)
public void importClasses(java.util.ResourceBundle classmap)
Classes in the java.lang package are imported by default, and they will not be looked up in the resource bundle passed to this method.
protected FunctorRef checkReservedNames(java.lang.String name) throws ParseException
ParseException
public Generator parseGenerator(java.lang.String str) throws ParseException
ParseException
public Generator parseGenerator() throws ParseException
ParseException
public UnaryFunctor parseUnary(java.lang.String str, java.lang.Class argType) throws ParseException
parseUnary
public UnaryFunctor parseUnary(java.lang.Class argType)
throws ParseException
- Parses the current input to create a UnaryFunctor that takes an argument of the
given type.
- Throws:
ParseException
parseBinary
public BinaryFunctor parseBinary(java.lang.String str,
java.lang.Class arg1Type,
java.lang.Class arg2Type)
throws ParseException
- Parses the string to create a BinaryFunctor that takes arguments of the
given types.
- Throws:
ParseException
parseBinary
public BinaryFunctor parseBinary(java.lang.Class arg1Type,
java.lang.Class arg2Type)
throws ParseException
- Parses the current input to create a BinaryFunctor that takes arguments of the
given types.
- Throws:
ParseException
getReturnType
public java.lang.Class getReturnType()
- Returns the type of object returned by the last functor parsed.
- Throws:
java.lang.IllegalStateException
- if the parser has not been used or if
parsing the last functor resulted in an exception being thrown.
Overview
Package
Class
Tree
Deprecated
Index
Help<
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2002-2004 David A. Hall. All Rights Reserved.