uk.ac.gla.dcs.renaissance.iqir.parser
Class IQIRParser

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.parser.IQIRParser
All Implemented Interfaces:
IQIRParserConstants

public class IQIRParser
extends Object
implements IQIRParserConstants


Nested Class Summary
static class IQIRParser.SOperator
           
 
Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 IQIRParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface uk.ac.gla.dcs.renaissance.iqir.parser.IQIRParserConstants
ALPHANUMERICS, COMMA, DEFAULT, DIGIT, EOF, LBRACKET, LCURLY, LETTER, LETTERDIGITEXTRAS, LPAREN, MINUS, NUMBER, PLUS, QUOTES, RBRACKET, RCURLY, RPAREN, tokenImage, XML_NAME, XML_NAMECHAR, XML_TAG
 
Constructor Summary
IQIRParser(InputStream stream)
          Constructor with InputStream.
IQIRParser(InputStream stream, String encoding)
          Constructor with InputStream and supplied encoding
IQIRParser(IQIRParserTokenManager tm)
          Constructor with generated Token Manager.
IQIRParser(Reader stream)
          Constructor.
 
Method Summary
 Token alphanumeric()
           alphanumeric ::= ALPHANUMERICS
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 Operator expr()
          Expression
expr: operators (("+" | "-") operators)*
 ParseException generateParseException()
          Generate ParseException.
 Token getNextToken()
          Get the next Token.
 Token getToken(int index)
          Get the specific Token.
 TopicOperator iqirTopic()
          An IQIR topic is described by a set of tensors.
 MultiTermOperator multiterms()
          A multiterms is a sequence of words
 Operator operator()
           operator ::= ( ( LBRACKET operators RBRACKET ) | ( LPAREN expr RPAREN ) | ( QUOTES multiterms QUOTES ) )
 Mixture operators(boolean superpose)
          Operators
 void ReInit(InputStream stream)
          Reinitialise.
 void ReInit(InputStream stream, String encoding)
          Reinitialise.
 void ReInit(IQIRParserTokenManager tm)
          Reinitialise.
 void ReInit(Reader stream)
          Reinitialise.
 List<Operator> tensors()
          tensor: either {} ops or
 TermOperator word()
          A word is a sequence: of alphabetics, of digits, of digits preceeded by a negative (-) sign (a negative number).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public IQIRParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

IQIRParser

public IQIRParser(InputStream stream)
Constructor with InputStream.


IQIRParser

public IQIRParser(InputStream stream,
                  String encoding)
Constructor with InputStream and supplied encoding


IQIRParser

public IQIRParser(Reader stream)
Constructor.


IQIRParser

public IQIRParser(IQIRParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

iqirTopic

public final TopicOperator iqirTopic()
                              throws ParseException,
                                     Exception
An IQIR topic is described by a set of tensors. Each of these tensors denotes an aspect of the information need which must be satisfied. < br/ >
iqir-topic ::= tensors (COMMA tensors)* EOF

Throws:
ParseException
Exception

tensors

public final List<Operator> tensors()
                             throws ParseException,
                                    Exception
tensor: either {} ops or
tensors ::= ((expr) | LCURLY expr (COMMA expr)* RCURLY (operators)?
            ((PLUS | MINUS) operators)* ) )

Throws:
ParseException
Exception

expr

public final Operator expr()
                    throws ParseException,
                           Exception
Expression
expr: operators (("+" | "-") operators)*
expr ::= operators (( PLUS | MINUS) operators)*

Throws:
ParseException
Exception

operators

public final Mixture operators(boolean superpose)
                        throws ParseException,
                               Exception
Operators
operators ::= (operator)+

Throws:
ParseException
Exception

operator

public final Operator operator()
                        throws ParseException,
                               Exception
operator ::= (  ( LBRACKET operators RBRACKET ) |
                ( LPAREN expr RPAREN ) |
                ( QUOTES multiterms QUOTES ) )

Throws:
ParseException
Exception

multiterms

public final MultiTermOperator multiterms()
                                   throws ParseException,
                                          Exception
A multiterms is a sequence of words
multiterms := (word)*

Throws:
ParseException
Exception

word

public final TermOperator word()
                        throws ParseException,
                               Exception
A word is a sequence: of alphabetics, of digits, of digits preceeded by a negative (-) sign (a negative number). Alphanumerics starting with an alpha (for both ip1 tags and Y2K queries). As the operators are also valid search terms, a word is operator or a sequence of alphabetic characters
word ::= (NUMBER | DIGIT | alphanumeric)

Throws:
ParseException
Exception

alphanumeric

public final Token alphanumeric()
                         throws ParseException,
                                Exception
alphanumeric ::= ALPHANUMERICS

Throws:
ParseException
Exception

ReInit

public void ReInit(InputStream stream)
Reinitialise.


ReInit

public void ReInit(InputStream stream,
                   String encoding)
Reinitialise.


ReInit

public void ReInit(Reader stream)
Reinitialise.


ReInit

public void ReInit(IQIRParserTokenManager tm)
Reinitialise.


getNextToken

public final Token getNextToken()
Get the next Token.


getToken

public final Token getToken(int index)
Get the specific Token.


generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.



Copyright © 2011. All Rights Reserved.