|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.oklab.compiler.syntaxtree.Node
org.oklab.compiler.syntaxtree.expression.Expression
org.oklab.compiler.syntaxtree.expression.Variable
public abstract class Variable
変数を表す抽象クラス. 変数は実際にはローカル変数やグローバル変数で表すが共通する情報はこのクラス で定義してある.
VariableOfGlobal,
VariableOfLocal| フィールドの概要 | |
|---|---|
protected int |
type
型情報. |
| クラス org.oklab.compiler.syntaxtree.Node から継承されたフィールド |
|---|
parent |
| コンストラクタの概要 | |
|---|---|
Variable(Node parent,
int type)
Creates a new instance of Variable |
|
| メソッドの概要 | |
|---|---|
abstract Variable |
createReference(Node parent)
|
int |
emitCode(CodeBufferManager code)
istore用インタフェース. |
protected abstract void |
emitCode(CodeBufferManager code,
boolean isLoad)
フィールドからの読み込みか、書き込みのバイトコードを出力. |
int |
emitCode(CodeBufferManager code,
int stackPointer)
iload用インタフェース. |
private void |
isInt(int type)
|
Statement |
parseXStatement(Node parent,
SourceReader sReader)
variableAAA = 10 * 20;のような文は代入文である.はじめが変数で始まる文は 代入文か関数呼び出しになる.ここでは代入文の場合の構文解析になる. |
| クラス 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 |
| フィールドの詳細 |
|---|
protected int type
| コンストラクタの詳細 |
|---|
public Variable(Node parent,
int type)
| メソッドの詳細 |
|---|
public abstract Variable createReference(Node parent)
public Statement parseXStatement(Node parent,
SourceReader sReader)
throws CompileError
Expression 内の parseXStatementCompileErrorCall.parseXStatement(Node parent, SourceReader sReader),
Substitute
public int emitCode(CodeBufferManager code)
throws CompileError
CompileErrorSubstitute.emitCode(CodeBufferManager)
public int emitCode(CodeBufferManager code,
int stackPointer)
throws CompileError
Expression 内の emitCodeCompileError
private void isInt(int type)
throws CompileError
CompileError
protected abstract void emitCode(CodeBufferManager code,
boolean isLoad)
throws CompileError
code - 書き込み先バッファisLoad - trueの場合、フィールドの読み込み,falseの場合フィールドの書き込み
バイトコードを出力する.
CompileError
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||