CAR (Context-Aware Retrieval) v1.0

Class Parser

java.lang.Object
  |
  +--Parser
All Implemented Interfaces:
CarFace, LexerFace
Direct Known Subclasses:
ParserCollection, ParserSession

public abstract class Parser
extends java.lang.Object
implements LexerFace


Field Summary
protected  boolean btok
           
protected  AttributeTuple cAttributeTuple
           
protected  CommentTuple cCommentTuple
           
protected  Document cDocument
           
protected  Field cField
           
protected  java.lang.String cFieldName
           
protected  char ctok
           
protected  java.lang.String currLabel
           
protected  int currLiteralType
           
protected  java.lang.String currLiteralVal
           
protected  java.lang.Object currVal
           
protected  Value cValue
           
protected  ValueTuple cValueTuple
           
protected  ValueTupleVector cValueTupleVector
           
protected  Collection docs
           
protected  double dtok
           
protected  boolean gotAField
           
protected  int grammar
           
protected  java.lang.String id
           
protected  int itok
           
protected  long ltok
           
protected  ParseControl parseControl
           
protected  int peeksy
           
protected  float rtok
           
protected  java.lang.String stok
           
protected  int sy
           
protected  java.lang.String syval
           
protected  java.lang.String tag
           
 
Fields inherited from interface LexerFace
ACTIVETAGS, AMPERSAND, any, ANY, COLON, COMMA, COMMENT, DIV, ELLIPSIS, ENDOFSOURCE, ENDTAG, EQUALS, GT, IDENTIFIER, LBRACE, LBRACKET, LPARENT, LT, MATCHERMESSAGE, MINUS, NOT, NOTE, PERIOD, PLUS, QUESTION, RBRACE, RBRACKET, RPARENT, SEMICOLON, STAR, STARTTAG, TILDE, TOKENMIN, tokenNames
 
Fields inherited from interface CarFace
BOOLEAN_LITERAL, COLLECTION, DOUBLE_LITERAL, EXTERNAL, grammarNames, INTERNAL, KEYPHRASE, LITERALcapacityIncrement, LITERALinitialCapacity, MARKUP, SERIAL, SESSION, STRING_LITERAL, STRINGVALUE_LITERAL
 
Constructor Summary
Parser(ParseControl prog, Lexer plexer)
           
 
Method Summary
protected  void addField()
           
protected  boolean AttributeTuple()
           
(package private)  boolean BooleanLiteral()
           
protected  boolean CommentTuple()
           
protected  boolean Document()
           
(package private)  boolean EndTag()
           
protected  boolean error(java.lang.String s)
           
abstract  boolean Field()
           
 int getLineno()
           
(package private)  boolean Identifier()
           
protected  void insymbol()
           
protected  void insymbol(int dummy)
           
(package private)  boolean isNumericLiteral(int sym)
           
protected  boolean Label()
           
protected  java.lang.Object maxVal(int valType)
           
protected  java.lang.Object minVal(int valType)
           
(package private)  boolean NumericLiteral()
           
protected  int orderAndCast(int firstValType, int secondValType, java.lang.Object[] vals)
           
protected  void orderAndCastError(int type1, int type2)
           
 boolean parse(Collection docs, int grammar)
           
protected  boolean PrimitiveValue()
           
 void printTables()
          //------------------------------- public String getSourceLine(int line) { // puts lineno at beginning of output String s=source; int lineno,i,j,len; lineno=i=j=0; len=s.length(); while(i= i) { if(lineno==line) return s.substring(i,j); i=j+1; } else return s.substring(i,len); lineno++; } return null; }
protected  boolean RangeOrPrimtiveValue()
           
protected  boolean RangeValue()
           
abstract  boolean Start()
           
(package private)  boolean StartTag()
           
(package private)  boolean StringLiteral()
           
(package private)  boolean StringValueLiteral()
           
protected  void swap(java.lang.Object[] vals)
           
 void t(java.lang.String s)
           
protected  boolean Value()
           
protected  boolean ValueSpec()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sy

protected int sy

peeksy

protected int peeksy

syval

protected java.lang.String syval

id

protected java.lang.String id

tag

protected java.lang.String tag

parseControl

protected ParseControl parseControl

itok

protected int itok

ltok

protected long ltok

btok

protected boolean btok

rtok

protected float rtok

dtok

protected double dtok

ctok

protected char ctok

stok

protected java.lang.String stok

currLiteralType

protected int currLiteralType

currLiteralVal

protected java.lang.String currLiteralVal

currVal

protected java.lang.Object currVal

currLabel

protected java.lang.String currLabel

cValue

protected Value cValue

cValueTuple

protected ValueTuple cValueTuple

cValueTupleVector

protected ValueTupleVector cValueTupleVector

cAttributeTuple

protected AttributeTuple cAttributeTuple

cCommentTuple

protected CommentTuple cCommentTuple

cFieldName

protected java.lang.String cFieldName

cField

protected Field cField

cDocument

protected Document cDocument

gotAField

protected boolean gotAField

docs

protected Collection docs

grammar

protected int grammar
Constructor Detail

Parser

public Parser(ParseControl prog,
              Lexer plexer)
Method Detail

Field

public abstract boolean Field()
                       throws java.lang.Exception

Start

public abstract boolean Start()
                       throws java.lang.Exception

t

public void t(java.lang.String s)

getLineno

public int getLineno()

error

protected boolean error(java.lang.String s)
                 throws java.lang.Exception

printTables

public void printTables()
//------------------------------- public String getSourceLine(int line) { // puts lineno at beginning of output String s=source; int lineno,i,j,len; lineno=i=j=0; len=s.length(); while(i= i) { if(lineno==line) return s.substring(i,j); i=j+1; } else return s.substring(i,len); lineno++; } return null; }

insymbol

protected void insymbol(int dummy)
                 throws java.lang.Exception

insymbol

protected void insymbol()
                 throws java.lang.Exception

Identifier

boolean Identifier()
             throws java.lang.Exception

StartTag

boolean StartTag()
           throws java.lang.Exception

EndTag

boolean EndTag()
         throws java.lang.Exception

isNumericLiteral

boolean isNumericLiteral(int sym)

NumericLiteral

boolean NumericLiteral()
                 throws java.lang.Exception

BooleanLiteral

boolean BooleanLiteral()
                 throws java.lang.Exception

StringLiteral

boolean StringLiteral()
                throws java.lang.Exception

StringValueLiteral

boolean StringValueLiteral()
                     throws java.lang.Exception

minVal

protected java.lang.Object minVal(int valType)

maxVal

protected java.lang.Object maxVal(int valType)

parse

public boolean parse(Collection docs,
                     int grammar)
              throws java.lang.Exception

Document

protected boolean Document()
                    throws java.lang.Exception

addField

protected void addField()
                 throws java.lang.Exception

AttributeTuple

protected boolean AttributeTuple()
                          throws java.lang.Exception

ValueSpec

protected boolean ValueSpec()
                     throws java.lang.Exception

Label

protected boolean Label()
                 throws java.lang.Exception

Value

protected boolean Value()
                 throws java.lang.Exception

RangeOrPrimtiveValue

protected boolean RangeOrPrimtiveValue()
                                throws java.lang.Exception

PrimitiveValue

protected boolean PrimitiveValue()
                          throws java.lang.Exception

RangeValue

protected boolean RangeValue()
                      throws java.lang.Exception

CommentTuple

protected boolean CommentTuple()
                        throws java.lang.Exception

orderAndCast

protected int orderAndCast(int firstValType,
                           int secondValType,
                           java.lang.Object[] vals)
                    throws java.lang.Exception

orderAndCastError

protected void orderAndCastError(int type1,
                                 int type2)
                          throws java.lang.Exception

swap

protected void swap(java.lang.Object[] vals)

CAR (Context-Aware Retrieval) v1.0

Submit bugs to Lindsey