org.activemath.exercises.parsers
Class CasParserMpl

java.lang.Object
  extended by org.activemath.exercises.openmath.OpenMath
      extended by org.activemath.exercises.CasParser
          extended by org.activemath.exercises.parsers.CasParserMpl
All Implemented Interfaces:
CasParserMplConstants

public class CasParserMpl
extends CasParser
implements CasParserMplConstants

CAS parser for Maple™ syntax.

Version:
$Revision: 1.43 $ $Date: 2012/04/24 12:30:16 $

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 CasParserMplTokenManager token_source
           
 
Fields inherited from class org.activemath.exercises.CasParser
log, omDictionaryCd, omDictionaryName, omDictionaryUnaryCd, omDictionaryUnaryName
 
Fields inherited from class org.activemath.exercises.openmath.OpenMath
openmathNamespace
 
Fields inherited from interface org.activemath.exercises.parsers.CasParserMplConstants
APPLICATION, DEFAULT, DIGIT, DOUBLE, EOF, EOL, INTEGER, STRING, SYMBOL, tokenImage, VARIABLE
 
Constructor Summary
CasParserMpl(CasParserMplTokenManager tm)
           
CasParserMpl(InputStream stream)
           
CasParserMpl(Reader stream)
           
 
Method Summary
 void advanceToNextEOL()
          Advance to next End Of Line (EOL) or end of input.
 List argumentList()
           
 void disable_tracing()
           
 org.jdom.Element element()
           
 void enable_tracing()
           
 org.jdom.Element expr()
           
 org.jdom.Element exprPrec1()
           
 org.jdom.Element exprPrec2()
           
 org.jdom.Element exprPrec3()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
static void main(String[] args)
           
 org.jdom.Element nextLine()
          Entry point for the recursive descendant parser.
 void ReInit(CasParserMplTokenManager tm)
           
 void ReInit(InputStream stream)
           
 void ReInit(Reader stream)
           
 org.jdom.Element unary()
           
 
Methods inherited from class org.activemath.exercises.CasParser
console, linearToOpenMath, linearToOpenMath, newCasParser, newCasParser, newCasParser, newCasParser, newCasParser, newCasParser, nextOmobj, parseForeign, symbol, symbolUnary
 
Methods inherited from class org.activemath.exercises.openmath.OpenMath
applyBinding, getOmobjContents, oma, oma, oma, oma, oma, ombind, ombind, ombind, ombind, ombind, ombvar, ombvar, ombvar, ombvar, ome, ome, ome, ome, omf, omf, omi, omi, omobj, oms, omstr, omv, output, setOmNamespace, substituteVariables, tidyForOpenMath1, toDouble, toInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public CasParserMplTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

CasParserMpl

public CasParserMpl(InputStream stream)

CasParserMpl

public CasParserMpl(Reader stream)

CasParserMpl

public CasParserMpl(CasParserMplTokenManager tm)
Method Detail

main

public static void main(String[] args)

advanceToNextEOL

public void advanceToNextEOL()
Description copied from class: CasParser
Advance to next End Of Line (EOL) or end of input. Is overriden by the subclasses that implement the actual parser.

Overrides:
advanceToNextEOL in class CasParser

nextLine

public final org.jdom.Element nextLine()
                                throws ParseException
Description copied from class: CasParser
Entry point for the recursive descendant parser. Is overriden by the subclasses that implement the actual parser. This function is to be used only if you want to handle the ParseException and TokenMgrError objects yourself. Normally it's better to call nextOmobj() that encapsulates all this and returns always an OMOBJ, which contains an OME (OM error) when there is some parsing error.

Overrides:
nextLine in class CasParser
Returns:
OpenMath object encoded as a JDOM tree.
Throws:
ParseException - Problem when parsing.

expr

public final org.jdom.Element expr()
                            throws ParseException
Throws:
ParseException

exprPrec1

public final org.jdom.Element exprPrec1()
                                 throws ParseException
Throws:
ParseException

exprPrec2

public final org.jdom.Element exprPrec2()
                                 throws ParseException
Throws:
ParseException

exprPrec3

public final org.jdom.Element exprPrec3()
                                 throws ParseException
Throws:
ParseException

argumentList

public final List argumentList()
                        throws ParseException
Throws:
ParseException

unary

public final org.jdom.Element unary()
                             throws ParseException
Throws:
ParseException

element

public final org.jdom.Element element()
                               throws ParseException
Throws:
ParseException

ReInit

public void ReInit(InputStream stream)

ReInit

public void ReInit(Reader stream)

ReInit

public void ReInit(CasParserMplTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()