Changeset 3802


Ignore:
Timestamp:
Apr 6, 2014, 2:27:06 AM (3 years ago)
Author:
ksherdy
Message:

Minor clean up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/b2k/ast/Accessors.java

    r3797 r3802  
    1818        ////////////////////////////////////////////////////////////////////////////
    1919        public static List<StructDefNode> structDefNodes(ProgramNode node) {
    20                
    2120                List<StructDefNode> structTypeDecls = new ArrayList<StructDefNode>();
    22                
    2321                for(ASTNode child: node.getChildren()) {
    2422                        if(child instanceof StructDefNode) {
     
    2624                        }
    2725                }
    28                
    2926                return structTypeDecls;
    3027        }
     
    177174                       
    178175        public static KernelFuncDefNode kernelFuncDefNode(KernelDefNode node) {
    179                 return (KernelFuncDefNode) node.child(1);
     176                ASTNode kernelFuncDefNode = node.child(1);
     177                assert kernelFuncDefNode instanceof KernelFuncDefNode;
     178                return (KernelFuncDefNode) kernelFuncDefNode;
    180179        }
    181180       
     
    196195        }
    197196       
    198     public static KernelFuncDefNode funcDefForName(ASTNode node, String name) {
     197    public static KernelFuncDefNode funcDefForName(ASTNode node, String name) { // KH: refactor
    199198
    200199        if(node instanceof KernelFuncDefNode) {
     
    224223        ////////////////////////////////////////////////////////////////////////////
    225224        public static IdentifierNode funcIdentifier(KernelFuncDefNode node) {
    226                 return (IdentifierNode) node.child(0);
     225                ASTNode identifierNode = node.child(0);
     226                assert identifierNode instanceof IdentifierNode;
     227                return (IdentifierNode) identifierNode;
    227228        }
    228229       
Note: See TracChangeset for help on using the changeset viewer.