////////////////////////////////////////////////////////////////////// // The contents of this file are subject to the Mozilla Public License // Version 1.1 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License // at http://www.mozilla.org/MPL/ // // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. // See the License for the specific language governing rights and // limitations under the License. // // The Original Code is "Mini". // // The Initial Developer of the Original Code is David Wallace Croft // (croft@alumni.caltech.edu, http://www.alumni.caltech.edu/~croft/). // Portions created by David Wallace Croft are // Copyright (C) 1999 David Wallace Croft. All Rights Reserved. // // Contributor(s): ////////////////////////////////////////////////////////////////////// package com.orbs.open.a.mpl.compiler.mini.node; import java.util.*; /********************************************************************* * Parse tree node for the Mini programming language. * * @see * MiniNode * * @author * David W. Croft * @version * 1999-04-25 *********************************************************************/ public class ProgramMiniNode extends AbstractMiniNode ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// { protected BlockMiniNode blockMiniNode; ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public ProgramMiniNode ( BlockMiniNode blockMiniNode ) throws SemanticErrorException ////////////////////////////////////////////////////////////////////// { this.blockMiniNode = blockMiniNode; checkSemantics ( new Stack ( ) ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public BlockMiniNode getBlockMiniNode ( ) { return blockMiniNode; } ////////////////////////////////////////////////////////////////////// // MiniNode interface methods ////////////////////////////////////////////////////////////////////// public void generate ( MiniNodeCodeVisitor miniNodeCodeVisitor ) ////////////////////////////////////////////////////////////////////// { miniNodeCodeVisitor.generateProgram ( this ); } public void checkSemantics ( Stack parentMiniNodeStack ) throws SemanticErrorException ////////////////////////////////////////////////////////////////////// { parentMiniNodeStack.push ( this ); blockMiniNode.checkSemantics ( parentMiniNodeStack ); parentMiniNodeStack.pop ( ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// }