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

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

public class Substitute
extends Statement

代入文.

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

フィールドの概要
private  Variable destination
          格納先変数.代入文の左辺.
private  Expression source
          代入文の右辺.
 
クラス org.oklab.compiler.syntaxtree.Node から継承されたフィールド
parent
 
コンストラクタの概要
Substitute(Node parent, Variable destination, 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
 

フィールドの詳細

destination

private Variable destination
格納先変数.代入文の左辺.


source

private Expression source
代入文の右辺.

コンストラクタの詳細

Substitute

public Substitute(Node parent,
                  Variable destination,
                  SourceReader sReader)
           throws CompileError
インスタンス生成時に構文解析.

パラメータ:
parent - 親ノード.
destination - 代入先.
sReader - ソースコードリーダ.
例外:
CompileError - 構文解析に失敗したらこの例外を投げる.
メソッドの詳細

emitCode

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

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