gov.llnl.babel.parsers.sidl2

Class ParseTree2ASTVisitor

Implemented Interfaces:
SIDLParserVisitor

public class ParseTree2ASTVisitor
extends java.lang.Object
implements SIDLParserVisitor

This class turns the JJTree/JavaCC generated parse tree into a bona fide AST. The output AST can then be traversed for syntax checking, cloning, modification, and (eventually) better code generators.

Field Summary

protected LinkedList
d_attrs
protected MsgList
d_msgs
protected Stack
d_postfixStack
protected Stack
d_prefixStack

Constructor Summary

ParseTree2ASTVisitor(MsgList msgs)

Method Summary

protected void
checkAttrs(String typeName, IAttributable node, Object data, legal_attrs[] )
protected String
resolveDoc(ParseTreeNode node)
Resolve the doc string from the special tokens preceding the node
Object
visit(ParseTreeNode src, Object data)

Field Details

d_attrs

protected LinkedList d_attrs

d_msgs

protected MsgList d_msgs

d_postfixStack

protected Stack d_postfixStack

d_prefixStack

protected Stack d_prefixStack

Constructor Details

ParseTree2ASTVisitor

public ParseTree2ASTVisitor(MsgList msgs)

Method Details

checkAttrs

protected void checkAttrs(String typeName,
                          IAttributable node,
                          Object data,
                          legal_attrs[] )

resolveDoc

protected String resolveDoc(ParseTreeNode node)
Resolve the doc string from the special tokens preceding the node
Parameters:
node -
Returns:

visit

public Object visit(ParseTreeNode src,
                    Object data)
Specified by:
visit in interface SIDLParserVisitor