All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class lib.Util

java.lang.Object
   |
   +----lib.Util

public class Util
extends Object
This class provides several static methods, that help to create assembler output for the Jasmin assmbler.


Constructor Index

 o Util()

Method Index

 o getClass(Node)
Returns the class, i.e.
 o getClassName(Node)
Returns the name of the class, the given node is contained in.
 o getMethod(Node)
Returns the method, i.e.
 o toJVMArglistType(Node)
Takes the argument list of a method as input an creates a string that encodes the types of the arguments.
 o toJVMClassName(String)
Converts a classname, i.e.
 o toJVMName(String)
Converts a composed name, i.e.
 o toJVMType(Node, Node)
Converts a type to a string, i.e.

Constructors

 o Util
 public Util()

Methods

 o toJVMName
 public static String toJVMName(String s)
Converts a composed name, i.e. my.Class.data -> my/Class/data

Parameters:
s - composed name in Java syntax
Returns:
composed name in Jasmin/JVM syntax
 o toJVMClassName
 public static String toJVMClassName(String s)
Converts a classname, i.e. my.brandnew.Class -> Lmy/brandnew/Class;

Parameters:
s - classname in Java syntax
Returns:
classname in Jasmin/JVM syntax
 o toJVMType
 public static String toJVMType(Node n,
                                Node dim)
Converts a type to a string, i.e. T_VOID -> V T_INT -> I its.my.Class -> Lits/my/Class; If n is not null and not of type T_DUMMY, the string is generated using toJVMArrayType.

Parameters:
n - reference to a node of type T_VOID, T_INT, or T_STRING
dim - if not null or of type T_DUMMY, then is must reference a list of T_DIMENSION.
Returns:
a string describing the specified type in Jasmin/JVM syntax
 o toJVMArglistType
 public static String toJVMArglistType(Node n)
Takes the argument list of a method as input an creates a string that encodes the types of the arguments.

Parameters:
n - is a list of T_VARSPEC
Returns:
list of argument types encoded in a string
 o getClass
 public static Node getClass(Node n)
Returns the class, i.e. the Node object of type T_CLASS, the given node is contained in.

 o getClassName
 public static String getClassName(Node n)
Returns the name of the class, the given node is contained in.

 o getMethod
 public static Node getMethod(Node n)
Returns the method, i.e. the Node object of type T_METHDEC, the given node is contained in.


All Packages  Class Hierarchy  This Package  Previous  Next  Index