|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pl.edu.pjwstk.yaod.yaql.Interpreter
The Interpreter
class represents the main code responsible
for program interpretation. It consists of environmental stack,
query result stack, abstract syntax tree and a link to the data store.
EnvironmentalStack
,
QueryResultStack
,
AbstractSyntaxTree
,
SVRP
Constructor Summary | |
Interpreter(SVRP sp)
Creates a new interpreter with specified sp , which is a
server process of the data store. |
Method Summary | |
Result |
convertToProtocolResult(QueryResult r)
The method takes the query/program result as an argument and converts it into the form which is suitable for serialization (used for passing the results through network). |
javax.swing.tree.DefaultMutableTreeNode |
dumpAST()
Returns the structure of abstract syntax tree suitable for displaying it on graphic panel in tree form. |
void |
dumpAST(AbstractSyntaxTree AST,
javax.swing.tree.DefaultMutableTreeNode parentNode)
The dumpAST is the recursive method which prepares the abstract
syntax tree structure for being displayed on graphic interface. |
javax.swing.tree.DefaultMutableTreeNode |
dumpDB()
Returns the structure of object store suitable for displaying it on graphic interface in the tree form. |
javax.swing.tree.DefaultMutableTreeNode |
dumpENVS()
Returns the structure of environmental stack suitable for displaying it on graphic panel in tree form. |
void |
dumpENVS(javax.swing.tree.DefaultMutableTreeNode parentNode)
The dumpENVS is the recursive method which prepares the
environmental stack structure for being displayed on graphic interface. |
AbstractSyntaxTree |
getAST()
Returns the abstract syntax tree. |
ObjectID |
getEntry()
Returns the entry of the object store. |
EnvironmentalStack |
getENVS()
Returns the environmental stack. |
java.io.PrintWriter |
getPW()
Returns the print writer which is an object responsible for displaying results. |
QueryResultStack |
getQRES()
Returns the query result stack. |
SVRP |
getSP()
Returns the server process. |
void |
initializeENVS()
The method responsible for initializing environmental stack. |
void |
setPW(java.io.PrintWriter PW)
Sets the print writer which is an object responsible for displaying results. |
java.util.Vector |
start(java.lang.String str)
The main method responsible for program interpretation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Interpreter(SVRP sp)
sp
, which is a
server process of the data store. It also initilizes properly the
environmental stack.sp
- a link to data store (server process).SVRP
,
EnvironmentalStack
Method Detail |
public EnvironmentalStack getENVS()
EnvironmentalStack
public QueryResultStack getQRES()
QueryResultStack
public AbstractSyntaxTree getAST()
AbstractSyntaxTree
public SVRP getSP()
SVRP
public java.io.PrintWriter getPW()
public void setPW(java.io.PrintWriter PW)
PW
- the object representing the print writer.public ObjectID getEntry()
ObjectID
,
SVRP
public java.util.Vector start(java.lang.String str) throws SBQLException
StringReader
).
Then the lexing/parsing process takes the part, which yields in the
abstract syntax tree form of the source program. Then the evaluation
process starts and at the end, the results of such evaluation, are
returned as an vector object (Vector
).str
- a string representation of a query/program.SBQLException
- if interpretation (lexing/parsing/evaluating)
process fails.public Result convertToProtocolResult(QueryResult r)
r
- the possible result of the program interpretation.QueryResult
,
Result
public void initializeENVS()
EnvironmentalStack
,
ActivationRecord
,
IdentifierValue
,
BinderValue
public javax.swing.tree.DefaultMutableTreeNode dumpENVS()
EnvironmentalStack
public void dumpENVS(javax.swing.tree.DefaultMutableTreeNode parentNode)
dumpENVS
is the recursive method which prepares the
environmental stack structure for being displayed on graphic interface.parentNode
- is the node representing the parent of the actual node,
in the tree hierarchy.public javax.swing.tree.DefaultMutableTreeNode dumpAST()
AbstractSyntaxTree
public void dumpAST(AbstractSyntaxTree AST, javax.swing.tree.DefaultMutableTreeNode parentNode)
dumpAST
is the recursive method which prepares the abstract
syntax tree structure for being displayed on graphic interface.AST
- is the abstract syntax tree node representing the actual node.parentNode
- is the node representing the parent of the actual node,
in the tree hierarchy.public javax.swing.tree.DefaultMutableTreeNode dumpDB()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |