|
SMACS | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
| DdlTableDeclaration | DdlTableDeclaration.java semantic wrapper. |
| SimpleNodeClone | wrapper around SimpleNode.
|
| SqlAsObjectName | SqlFieldName.java semantic wrapper. |
| SqlDataTypeFieldDeclaration | SqlDataTypeFieldDeclaration.java semantic wrapper. |
| SqlFieldList | SqlFieldList.java semantic wrapper. |
| SqlFieldName | SqlFieldName.java semantic wrapper. |
| SqlForeignKeyFieldDeclaration | SqlForeignKeyFieldDeclaration.java semantic wrapper. |
| SqlFromClause | SqlFromClause.java semantic wrapper. |
| SqlFromItem | SqlFromItem.java semantic wrapper. |
| SqlInsertFromStatement | SqlInsertFromStatement.java semantic wrapper. |
| SqlInsertIntoClause | SqlInsertIntoClause.java semantic wrapper. |
| SqlInsertIntoStatement | SqlInsertIntoStatement.java semantic wrapper. |
| SqlInsertNewFromStatement | SqlInsertNewFromStatement.java semantic wrapper. |
| SqlInsertTransformStatement | SqlInsertTransformStatement.java semantic wrapper. |
| SqlIntoTableClause | SqlIntoTableClause.java semantic wrapper. |
| SqlNodeClone | clone sql syntax nodes. |
| SqlOldNewHint | SqlIntoTableClause.java semantic wrapper. |
| SqlSelectItem | SqlSelectItem.java semantic wrapper. |
| SqlSelectStatement | SqlSelectStatement.java semantic wrapper. |
| SqlSelectWhereClause | SqlSelectWhereClause.java semantic wrapper. |
| SqlTableColumn | SqlTableColumn.java semantic wrapper. |
| SqlTableDeclaration | SqlTableDeclaration.java semantic wrapper. |
| SqlTableExpression | SqlTableExpression.java semantic wrapper. |
| SqlTableReference | SqlTableReference.java semantic wrapper. |
| SqlWhereClause | SqlWhereClause.java semantic wrapper. |
ParseTree SimpleNode to Sementic Subtype NodeCopy.
This directories contains classes derived from SimpleNode. They are instantiated from SimpleNode objects take out of a parse tree or a subtree copy of a parse tree.
// - assemble all helper functions into these classes // remember that instances of these class are clones! // thus modifications will not change the parse tree!
The common usage is something like
{
List list = tree.selectNodes("MyNodeName");
for (int i=0, ii=list.size(); i &; ii; ++i) {
MyNodeName node = new MyNodeName(list.get(i));
MySubNode entry = node.declaredMySubNode();
callForEntry(entry);
}
}
Per convention:
- all classes are specific subtypes of SimpleNode
- all classes are created as clones from their argument
- all return values of methods are also clones unless
- the method starts with "get*()", e.g. getName()
- the type of the returned clone is given in the method name
therefore, a method "object.declaredMySubNode()" will return a
copy of some child of that object with a SimpleNode-subclass
known as "class MySubNode". If the method would have been named
as "getMySubNode()" it would return a reference to the child
node instead of a copy. The reference would be a plain SimpleNode.
The usual implementation has a "public SimpleNode orig" member that points back to the original node - but this can not be asserted as being a reference into the parse tree since it may as well be a reference to a child of a clone node. The difference could only be detected with checking the classtype of the root of the tree - most parse trees have a root of ScriptNode type.
The "orig" member is actually useful for those algorithms that cut out a part of the parsetree (as clones) and quickly modify some values that the hold state of the algorithm. It allows you to easily dump the internal state of the algorithm as xml, and call other algorithms built on top of a smacs.tree as well.
|
SMACS | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||