org.oklab.compiler.syntaxtree.statement
クラス Return

java.lang.Object
  上位を拡張 org.oklab.compiler.syntaxtree.Node
      上位を拡張 org.oklab.compiler.syntaxtree.statement.Statement
          上位を拡張 org.oklab.compiler.syntaxtree.statement.Return

public class Return
extends Statement

return文の情報である"戻り値"を保持するクラス. コンストラクタを呼ぶとそのreturn文の構文解析を行い、その構文木をフィールドに 保持する.

導入されたバージョン:
1.0
バージョン:
1.0
作成者:
Satoshi Okita satoshiokita@gmail.com

フィールドの概要
private  Expression returnValue
           
 
クラス org.oklab.compiler.syntaxtree.Node から継承されたフィールド
parent
 
コンストラクタの概要
Return(Node parentBlock, SourceReader sReader)
           
 
メソッドの概要
 boolean emitCode(CodeBufferManager code)
          バイトコードの出力を行う.
 
クラス org.oklab.compiler.syntaxtree.Node から継承されたメソッド
getReturnType, localVariableCount, parseExpression, parseFactor, parseRefferenceOrCall, parseStatement, parseTerm, setParent
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

returnValue

private Expression returnValue
コンストラクタの詳細

Return

public Return(Node parentBlock,
              SourceReader sReader)
       throws CompileError
例外:
CompileError
メソッドの詳細

emitCode

public boolean emitCode(CodeBufferManager code)
                 throws CompileError
クラス Statement の記述:
バイトコードの出力を行う.

定義:
クラス Statement 内の emitCode
パラメータ:
code - 出力先のバッファ領域.
戻り値:
Return文の時はtrueを返す.その他の文の場合はfalseを返す. これにより、その文の後に更に文を書けるかどうか判断する.
例外:
CompileError - コードを出力できなかった場合にこの例外を出力する.