com.caucho.quercus.parser
Class QuercusParser

java.lang.Object
  extended by com.caucho.quercus.parser.QuercusParser

public class QuercusParser
extends java.lang.Object

Parses a PHP program.


Constructor Summary
QuercusParser(QuercusContext quercus)
           
QuercusParser(QuercusContext quercus, Path sourceFile, ReadStream is)
           
 
Method Summary
 void close()
           
 Expr createVar(java.lang.String name)
           
 QuercusParseException error(java.lang.String msg)
          Returns an error.
 java.lang.String getClassName()
          Returns the current class name
 ExprFactory getExprFactory()
           
 ExprFactory getFactory()
           
 java.lang.String getFileName()
          Returns the current filename.
 int getLine()
          Returns the current line
 Location getLocation()
          The location from which the last token was read.
 java.lang.String getParentClassName()
           
 java.lang.String getSelfClassName()
           
 java.lang.String getSystemFunctionName(java.lang.String name)
           
static boolean isSwitchLabel(java.lang.String label)
           
 boolean isUnicodeSemantics()
           
 QuercusProgram parse()
           
static QuercusProgram parse(QuercusContext quercus, Path path, ReadStream is)
           
static QuercusProgram parse(QuercusContext quercus, Path path, java.lang.String encoding)
           
static QuercusProgram parse(QuercusContext quercus, Path path, java.lang.String encoding, java.lang.String fileName, int line)
           
static QuercusProgram parse(QuercusContext quercus, ReadStream is)
           
static Expr parse(QuercusContext quercus, java.lang.String str)
           
static Expr parseDefault(ExprFactory factory, java.lang.String str)
           
static Expr parseDefault(java.lang.String str)
           
static QuercusProgram parseEval(QuercusContext quercus, java.lang.String str)
           
static QuercusProgram parseEvalExpr(QuercusContext quercus, java.lang.String str)
           
static AbstractFunction parseFunction(QuercusContext quercus, java.lang.String name, java.lang.String args, java.lang.String code)
           
 Function parseFunction(java.lang.String name, Path argPath, Path codePath)
           
 void setLocation(java.lang.String fileName, int line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuercusParser

public QuercusParser(QuercusContext quercus)

QuercusParser

public QuercusParser(QuercusContext quercus,
                     Path sourceFile,
                     ReadStream is)
Method Detail

setLocation

public void setLocation(java.lang.String fileName,
                        int line)

parse

public static QuercusProgram parse(QuercusContext quercus,
                                   Path path,
                                   java.lang.String encoding)
                            throws java.io.IOException
Throws:
java.io.IOException

parse

public static QuercusProgram parse(QuercusContext quercus,
                                   Path path,
                                   java.lang.String encoding,
                                   java.lang.String fileName,
                                   int line)
                            throws java.io.IOException
Throws:
java.io.IOException

parse

public static QuercusProgram parse(QuercusContext quercus,
                                   ReadStream is)
                            throws java.io.IOException
Throws:
java.io.IOException

parse

public static QuercusProgram parse(QuercusContext quercus,
                                   Path path,
                                   ReadStream is)
                            throws java.io.IOException
Throws:
java.io.IOException

parseEval

public static QuercusProgram parseEval(QuercusContext quercus,
                                       java.lang.String str)
                                throws java.io.IOException
Throws:
java.io.IOException

parseEvalExpr

public static QuercusProgram parseEvalExpr(QuercusContext quercus,
                                           java.lang.String str)
                                    throws java.io.IOException
Throws:
java.io.IOException

parseFunction

public static AbstractFunction parseFunction(QuercusContext quercus,
                                             java.lang.String name,
                                             java.lang.String args,
                                             java.lang.String code)
                                      throws java.io.IOException
Throws:
java.io.IOException

isUnicodeSemantics

public boolean isUnicodeSemantics()

parse

public static Expr parse(QuercusContext quercus,
                         java.lang.String str)
                  throws java.io.IOException
Throws:
java.io.IOException

parseDefault

public static Expr parseDefault(java.lang.String str)

parseDefault

public static Expr parseDefault(ExprFactory factory,
                                java.lang.String str)

getFileName

public java.lang.String getFileName()
Returns the current filename.


getClassName

public java.lang.String getClassName()
Returns the current class name


getLine

public int getLine()
Returns the current line


getExprFactory

public ExprFactory getExprFactory()

getFactory

public ExprFactory getFactory()

parse

public QuercusProgram parse()
                     throws java.io.IOException
Throws:
java.io.IOException

parseFunction

public Function parseFunction(java.lang.String name,
                              Path argPath,
                              Path codePath)
                       throws java.io.IOException
Throws:
java.io.IOException

createVar

public Expr createVar(java.lang.String name)

getSelfClassName

public java.lang.String getSelfClassName()

getParentClassName

public java.lang.String getParentClassName()

getSystemFunctionName

public java.lang.String getSystemFunctionName(java.lang.String name)

error

public QuercusParseException error(java.lang.String msg)
Returns an error.


getLocation

public Location getLocation()
The location from which the last token was read.

Returns:

isSwitchLabel

public static boolean isSwitchLabel(java.lang.String label)

close

public void close()