|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.upenn.gloDB.parser.Parser
public class Parser
The parser is created using javacc. To make changes to the parser, the files Parser.jj, Operation.java, Operator.java, and ParserUtils.java are the only files that should be edited. All other files are recreated by javacc from Parser.jj. After Parser.jj is edited, makeParser.bat should be run. This will update the relevant parser java files. After makeParser is run, then this file should be run to add the parser changes into gloDB.jar.
Nested Class Summary | |
---|---|
(package private) static class |
Parser.JJCalls
|
private static class |
Parser.LookaheadSuccess
|
Field Summary | |
---|---|
private java.lang.String |
id
The ID of the new Track object. |
private Parser.JJCalls[] |
jj_2_rtns
|
private int |
jj_endpos
|
private java.util.Vector |
jj_expentries
|
private int[] |
jj_expentry
|
private int |
jj_gc
|
private int |
jj_gen
|
(package private) SimpleCharStream |
jj_input_stream
|
private int |
jj_kind
|
private int |
jj_la
|
private int[] |
jj_la1
|
private static int[] |
jj_la1_0
|
private static int[] |
jj_la1_1
|
private Token |
jj_lastpos
|
private int[] |
jj_lasttokens
|
private Parser.LookaheadSuccess |
jj_ls
|
Token |
jj_nt
|
private int |
jj_ntk
|
private boolean |
jj_rescan
|
private Token |
jj_scanpos
|
private boolean |
jj_semLA
|
boolean |
lookingAhead
|
private java.util.ArrayList |
parsed
An ArrayList containing the parsed Tracks. |
private java.util.HashMap |
sequencePool
The set of Sequences to be used. |
Token |
token
|
ParserTokenManager |
token_source
|
private java.util.HashMap |
trackPool
The set of Tracks to be used. |
Fields inherited from interface edu.upenn.gloDB.parser.ParserConstants |
---|
allTRACKS, AND, ASSIGN, bAND, bMINUS, bNOT, bOR, DEFAULT, EOF, EOL, EQUALS, FROM, HOOK, IGNORE, INTEGER, LENGTH, lGROUP, lLENGTH, lLENGTH2, lREPEAT, lSET, MINUS, nINTEGER, OBJECT, OR, PLUS, POS, POSITIONS, REPEATED, rGROUP, rLENGTH, rREPEAT, rSET, sAND, SEPARATOR, SEQUENCE, sMINUS, SP0, SP1, STAR, TIMES, tokenImage, TRACK, WITHIN |
Constructor Summary | |
---|---|
Parser(java.io.InputStream stream)
|
|
Parser(ParserTokenManager tm)
|
|
Parser(java.io.Reader stream)
|
|
Parser(java.lang.String parse)
Construct a new Parser using trackPool as the set Tracks to search. |
Method Summary | |
---|---|
private void |
addLength(int a,
int b,
int c,
int d)
Deal with length/from values. |
private void |
addRepeat(int a,
int b,
int c,
int d)
Deal with repeat/within values. |
void |
allTracks()
|
Operation |
densityRepeat(Operation operation)
|
void |
disable_tracing()
|
void |
enable_tracing()
|
void |
expr(java.util.ArrayList ops)
|
Operation |
feature()
|
java.lang.String |
formatParsed()
|
ParseException |
generateParseException()
|
java.lang.String |
getId()
|
Token |
getNextToken()
|
Token |
getToken(int index)
|
Operation |
group()
|
void |
ignore()
|
private boolean |
jj_2_1(int xla)
|
private boolean |
jj_3_1()
|
private boolean |
jj_3R_3()
|
private boolean |
jj_3R_4()
|
private void |
jj_add_error_token(int kind,
int pos)
|
private Token |
jj_consume_token(int kind)
|
private static void |
jj_la1_0()
|
private static void |
jj_la1_1()
|
private int |
jj_ntk()
|
private void |
jj_rescan_token()
|
private void |
jj_save(int index,
int xla)
|
private boolean |
jj_scan_token(int kind)
|
Operation |
length(Operation operation)
|
void |
negate()
|
int |
nValue()
|
int |
operator()
|
Operation |
operatorRepeat(Operation operation)
|
Operation |
opExpr()
|
int |
oRepeat()
|
java.util.ArrayList |
parseLine()
|
int |
position()
|
void |
ReInit(java.io.InputStream stream)
|
void |
ReInit(ParserTokenManager tm)
|
void |
ReInit(java.io.Reader stream)
|
java.util.ArrayList |
run(java.util.HashMap trackPool,
java.util.HashMap sequencePool)
Performs the parsing. |
Operation |
sequence(Operation operation)
|
Sequence |
sequenceRef()
|
private java.lang.String |
stripDescriptor(java.lang.String a)
Chop off preceeding descriptor. |
java.lang.String |
toString()
Returns the string to be parsed and the same string having been parsed information. |
Operation |
track(int type)
|
java.lang.String |
trackAssign()
|
Track |
trackRef()
|
private boolean |
validOperation(java.util.ArrayList ops)
Test if 'ops' contains any Operations that lack a Feature. |
int |
value()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.ArrayList parsed
private java.util.HashMap trackPool
private java.util.HashMap sequencePool
private java.lang.String id
public ParserTokenManager token_source
SimpleCharStream jj_input_stream
public Token token
public Token jj_nt
private int jj_ntk
private Token jj_scanpos
private Token jj_lastpos
private int jj_la
public boolean lookingAhead
private boolean jj_semLA
private int jj_gen
private final int[] jj_la1
private static int[] jj_la1_0
private static int[] jj_la1_1
private final Parser.JJCalls[] jj_2_rtns
private boolean jj_rescan
private int jj_gc
private final Parser.LookaheadSuccess jj_ls
private java.util.Vector jj_expentries
private int[] jj_expentry
private int jj_kind
private int[] jj_lasttokens
private int jj_endpos
Constructor Detail |
---|
public Parser(java.lang.String parse) throws ParseException
ParseException
public Parser(java.io.InputStream stream)
public Parser(java.io.Reader stream)
public Parser(ParserTokenManager tm)
Method Detail |
---|
public java.lang.String getId()
public java.util.ArrayList run(java.util.HashMap trackPool, java.util.HashMap sequencePool) throws ParseException
ParseException
private boolean validOperation(java.util.ArrayList ops)
public java.lang.String toString()
toString
in class java.lang.Object
private void addLength(int a, int b, int c, int d)
private void addRepeat(int a, int b, int c, int d)
private java.lang.String stripDescriptor(java.lang.String a)
public java.lang.String formatParsed()
public final java.util.ArrayList parseLine() throws ParseException
ParseException
public final java.lang.String trackAssign() throws ParseException
ParseException
public final void expr(java.util.ArrayList ops) throws ParseException
ParseException
public final Operation opExpr() throws ParseException
ParseException
public final Operation track(int type) throws ParseException
ParseException
public final Operation group() throws ParseException
ParseException
public final Operation feature() throws ParseException
ParseException
public final Operation densityRepeat(Operation operation) throws ParseException
ParseException
public final Operation operatorRepeat(Operation operation) throws ParseException
ParseException
public final Operation length(Operation operation) throws ParseException
ParseException
public final Operation sequence(Operation operation) throws ParseException
ParseException
public final void allTracks() throws ParseException
ParseException
public final Track trackRef() throws ParseException
ParseException
public final int position() throws ParseException
ParseException
public final Sequence sequenceRef() throws ParseException
ParseException
public final void ignore() throws ParseException
ParseException
public final void negate() throws ParseException
ParseException
public final int operator() throws ParseException
ParseException
public final int oRepeat() throws ParseException
ParseException
public final int value() throws ParseException
ParseException
public final int nValue() throws ParseException
ParseException
private final boolean jj_2_1(int xla)
private final boolean jj_3R_4()
private final boolean jj_3R_3()
private final boolean jj_3_1()
private static void jj_la1_0()
private static void jj_la1_1()
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.Reader stream)
public void ReInit(ParserTokenManager tm)
private final Token jj_consume_token(int kind) throws ParseException
ParseException
private final boolean jj_scan_token(int kind)
public final Token getNextToken()
public final Token getToken(int index)
private final int jj_ntk()
private void jj_add_error_token(int kind, int pos)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
private final void jj_rescan_token()
private final void jj_save(int index, int xla)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |