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

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.VariableOfGlobal

public class VariableOfGlobal
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
 
コンストラクタの概要
VariableOfGlobal(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
グローバル変数が保存されている場所のインデックス.

コンストラクタの詳細

VariableOfGlobal

public VariableOfGlobal(Node parent,
                        int type,
                        int storedIndex)
メソッドの詳細

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