edu.ustc.cs.compile.arch
类 Directive.Argument

java.lang.Object
  继承者 edu.ustc.cs.compile.arch.Directive.Argument
正在封闭类:
Directive

public static class Directive.Argument
extends java.lang.Object

This class provides a representation of the argument of the directive in the assembly language codes.
An argument could be a string, a label, or an integer.


字段摘要
private  java.lang.Integer integer
           
private  Label label
           
private  java.lang.String string
           
 
构造函数摘要
Directive.Argument(java.lang.Integer n)
          constructs an argument which is an integer.
Directive.Argument(Label label)
          constructs an argument which is a label.
Directive.Argument(java.lang.String string)
          constructs an argument which is a string.
 
方法摘要
 java.lang.Integer integer()
          gets the argument as an integer.
 boolean isInteger()
          decides whether this argument is an integer.
 boolean isLabel()
          decides whether this argument is a label.
 boolean isString()
          decides whether this argument is a string.
 Label label()
          gets the argument as a label.
 java.lang.String string()
          gets the argument as a string.
 java.lang.String toString()
          returns a string representation of this argument.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

string

private java.lang.String string

label

private Label label

integer

private java.lang.Integer integer
构造函数详细信息

Directive.Argument

public Directive.Argument(java.lang.String string)
constructs an argument which is a string.

参数:
string - the string

Directive.Argument

public Directive.Argument(Label label)
constructs an argument which is a label.

参数:
label - the label

Directive.Argument

public Directive.Argument(java.lang.Integer n)
constructs an argument which is an integer.

参数:
n - the integer
方法详细信息

string

public java.lang.String string()
gets the argument as a string.

返回:
the string, or null if this argument is not a string.

label

public Label label()
gets the argument as a label.

返回:
the label, or null if this argument is not a label.

integer

public java.lang.Integer integer()
gets the argument as an integer.

返回:
the integer, or null if this argument is not an integer.

isString

public boolean isString()
decides whether this argument is a string.

返回:
true if this argument is a string.

isLabel

public boolean isLabel()
decides whether this argument is a label.

返回:
true if this argument is a label.

isInteger

public boolean isInteger()
decides whether this argument is an integer.

返回:
true if this argument is an integer.

toString

public java.lang.String toString()
returns a string representation of this argument.

覆盖:
java.lang.Object 中的 toString
返回:
the string representation of this argument.