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

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

public class BlockStatement
extends Statement

このクラスは、ブロックを保持する.ブロックとは{}で囲まれた部分で、メソッドの 内部などである.

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

フィールドの概要
private  Block block
           
 
クラス org.oklab.compiler.syntaxtree.Node から継承されたフィールド
parent
 
コンストラクタの概要
BlockStatement(Node parent, SourceReader sReader)
          構文木にブロックを紐付けて、Blockに構文解析を依頼して構造を保持する.
 
メソッドの概要
 boolean emitCode(CodeBufferManager code)
          Blockにバイトコード生成を依頼する.
 
クラス 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
 

フィールドの詳細

block

private Block block
コンストラクタの詳細

BlockStatement

public BlockStatement(Node parent,
                      SourceReader sReader)
               throws CompileError
構文木にブロックを紐付けて、Blockに構文解析を依頼して構造を保持する.

パラメータ:
parent - 親ノード.
sReader - ソースコードリーダ.
例外:
CompileError - 構文解析に失敗した時に発生.
メソッドの詳細

emitCode

public boolean emitCode(CodeBufferManager code)
                 throws CompileError
Blockにバイトコード生成を依頼する.

定義:
クラス Statement 内の emitCode
パラメータ:
code - バイトコード保持領域.
戻り値:
Return文の時はtrueを返す.その他の文の場合はfalseを返す. これにより、その文の後に更に文を書けるかどうか判断する.
例外:
CompileError - バイトコード生成に失敗した時に発生.