org.oklab.compiler.syntaxtree.expression
クラス VariableOfLocal

java.lang.Object
  上位を拡張 org.oklab.compiler.syntaxtree.Node
      上位を拡張 org.oklab.compiler.syntaxtree.expression.Expression
          上位を拡張 org.oklab.compiler.syntaxtree.expression.Variable
              上位を拡張 org.oklab.compiler.syntaxtree.expression.VariableOfLocal

public class VariableOfLocal
extends Variable

ローカル変数を表現するクラス. ローカル変数やグローバル変数が共通して持つ情報は親クラスのVariableで定義してある.

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

フィールドの概要
private  int storedIndex
          ローカル変数が保存されている場所のインデックス.
 
クラス org.oklab.compiler.syntaxtree.expression.Variable から継承されたフィールド
type
 
クラス org.oklab.compiler.syntaxtree.Node から継承されたフィールド
parent
 
コンストラクタの概要
VariableOfLocal(Node parent, int type, int storedIndex)
          ローカル変数を保持する領域の生成.
 
メソッドの概要
 Variable createReference(Node parent)
           
protected  void emitCode(CodeBufferManager code, boolean isLoad)
          フィールドからの読み込みか、書き込みのバイトコードを出力.
 
クラス org.oklab.compiler.syntaxtree.expression.Variable から継承されたメソッド
emitCode, emitCode, parseXStatement
 
クラス 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
 

フィールドの詳細

storedIndex

private int storedIndex
ローカル変数が保存されている場所のインデックス.

コンストラクタの詳細

VariableOfLocal

public VariableOfLocal(Node parent,
                       int type,
                       int storedIndex)
ローカル変数を保持する領域の生成.

パラメータ:
parent - 親ノード.
type - 型(Tokenクラス参照).
storedIndex - 保存先のindex.
メソッドの詳細

createReference

public Variable createReference(Node parent)
定義:
クラス Variable 内の createReference

emitCode

protected void emitCode(CodeBufferManager code,
                        boolean isLoad)
                 throws CompileError
フィールドからの読み込みか、書き込みのバイトコードを出力.

定義:
クラス Variable 内の emitCode
パラメータ:
code - 書き込み先バッファ
isLoad - trueの場合、フィールドの読み込み,falseの場合フィールドの書き込み バイトコードを出力する.
例外:
CompileError