com.svincent.smalljava
Class SmallType.PrimitiveType

java.lang.Object
  |
  +--com.svincent.util.BaseObject
        |
        +--com.svincent.smalljava.SmallType
              |
              +--com.svincent.smalljava.SmallType.PrimitiveType
Enclosing class:
SmallType

protected static class SmallType.PrimitiveType
extends SmallType

Reprsents a primitive type, such as int or boolean. Users cannot create new primitive types: use one of the static final members on Type instead (such as Int or Void.


Inner classes inherited from class com.svincent.smalljava.SmallType
SmallType.ArrayType, SmallType.MethodType, SmallType.ObjectType, SmallType.PrimitiveType
 
Fields inherited from class com.svincent.smalljava.SmallType
Boolean, Byte, Char, debug, Double, EmptyArray, Float, Int, Long, Short, Void
 
Constructor Summary
protected SmallType.PrimitiveType(java.lang.String _typeName, char _typeChar)
           
 
Method Summary
protected  void addAdd(ClassFileWriter out)
          make an appropriately typed ADD operator (IADD, FADD, etc)
protected  void addArrayNew(ClassFileWriter out)
          make an appropriately typed NEWARRAY instruction
protected  void addArrayStore(ClassFileWriter out)
          make an appropriately typed ASTORE operator (IASTORE, AASTORE, etc)
protected  void addCmp(ClassFileWriter out)
          make an appropriately typed CMP operator (ISUB, LCMP, etc)
protected  void addLoad(ClassFileWriter out, int index)
          make an appropriately typed LOAD operator (ILOAD, ALOAD, etc)
protected  void addReturn(ClassFileWriter out)
          make an appropriately typed RETURN operator (IRETURN, LRETURN, etc)
protected  void addStore(ClassFileWriter out, int index)
          make an appropriately typed STORE operator (ISTORE, ASTORE, etc)
protected  void addSub(ClassFileWriter out)
          make an appropriately typed SUB operator (ISUB, FSUB, etc)
 boolean isPrimitive()
          Returns 'true' if this type is a primitive type, such as 'int'.
 java.lang.String toString()
           
 void writeAsJava(java.io.PrintWriter out)
          Write this type out as Java code, if possible.
 void writeDescriptor(java.io.PrintWriter out)
          Write this type's type descriptor to the given PrintWriter.
 
Methods inherited from class com.svincent.smalljava.SmallType
array, descriptorToString, main, parseFieldDescriptor, parseMethodDescriptor, tag, testField, testMethod
 
Methods inherited from class com.svincent.util.BaseObject
dump, dump, dumpToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmallType.PrimitiveType

protected SmallType.PrimitiveType(java.lang.String _typeName,
                                  char _typeChar)
Method Detail

isPrimitive

public boolean isPrimitive()
Returns 'true' if this type is a primitive type, such as 'int'.
Overrides:
isPrimitive in class SmallType

writeAsJava

public void writeAsJava(java.io.PrintWriter out)
Description copied from class: SmallType
Write this type out as Java code, if possible. If not possible, do your best.
Overrides:
writeAsJava in class SmallType

writeDescriptor

public void writeDescriptor(java.io.PrintWriter out)
Description copied from class: SmallType
Write this type's type descriptor to the given PrintWriter.
Overrides:
writeDescriptor in class SmallType

addAdd

protected void addAdd(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed ADD operator (IADD, FADD, etc)
Overrides:
addAdd in class SmallType

addSub

protected void addSub(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed SUB operator (ISUB, FSUB, etc)
Overrides:
addSub in class SmallType

addCmp

protected void addCmp(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed CMP operator (ISUB, LCMP, etc)
Overrides:
addCmp in class SmallType

addLoad

protected void addLoad(ClassFileWriter out,
                       int index)
Description copied from class: SmallType
make an appropriately typed LOAD operator (ILOAD, ALOAD, etc)
Overrides:
addLoad in class SmallType

addStore

protected void addStore(ClassFileWriter out,
                        int index)
Description copied from class: SmallType
make an appropriately typed STORE operator (ISTORE, ASTORE, etc)
Overrides:
addStore in class SmallType

addArrayStore

protected void addArrayStore(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed ASTORE operator (IASTORE, AASTORE, etc)
Overrides:
addArrayStore in class SmallType

addReturn

protected void addReturn(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed RETURN operator (IRETURN, LRETURN, etc)
Overrides:
addReturn in class SmallType

addArrayNew

protected void addArrayNew(ClassFileWriter out)
Description copied from class: SmallType
make an appropriately typed NEWARRAY instruction
Overrides:
addArrayNew in class SmallType

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object



This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/

Copyright © 1999 Shawn P. Vincent.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.