coins
Class SourceLanguageFortran

java.lang.Object
  extended bycoins.SourceLanguage
      extended bycoins.SourceLanguageFortran

public class SourceLanguageFortran
extends SourceLanguage

SourceLanguageFortran class Defines IR and Sym methods that depend on source language. Methods in this interface can be accessed in such way as symRoot.sourceLanguage.xxx(....). This module is implemented for C language.


Field Summary
static int[][] CONVERTIBLE
           
static int[][] REDEFINABLE
           
static boolean subscriptWithIndex
          subscriptWithIndex: Temporal parameter to be removed.
 
Fields inherited from class coins.SourceLanguage
functionsWithoutSideEffect, symRoot
 
Constructor Summary
SourceLanguageFortran(SymRoot pSymRoot)
           
 
Method Summary
 Type baseTypeOrigin(Type pBaseType)
          baseTypeOrigin: get origin of given base type pBaseType.
static java.lang.String getPureFloatString(java.lang.String pInternedName)
          getPureFloatString: //##21 Get the string representation of floating constant without language specific suffix.
static java.lang.String getPureIntString(java.lang.String pInternedName)
          getPureIntString: //##20 Get the string representation of integer constant composed of only digits.
 java.lang.String getSourceStringConst(java.lang.String pStringBody)
          getSourceStringConst: Change the pure string pStringBody to a string constant in source language.
 int getStringLength(java.lang.String pStringBody)
          getSourceStringConstStatic: Same as getSourceStringConst except that this is a static method.
 void initiateFunctionsWithoutSideEffect()
          Set the names of functions without side effect.
static boolean isC()
          isC:
static boolean isFortran()
          isFortran:
 boolean isMainProgram(Subp pSubp)
          isMainProgram:
 java.lang.String makeCstring(java.lang.String pStringBody)
          makeCstring: Change the pure string pStringBody to C string representation adding heading, trailing quotations and escape characters if required.
static java.lang.String makeCstringStatic(java.lang.String pStringBody)
          makeCstringStatic: Same as makeCstring except that this is a static method.
 java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
          makeCstringWithTrailing0: Change the pure string pStringBody to C string representation adding heading, trailing quotations and escape characters if required.
static java.lang.String makeCstringWithTrailing0static(java.lang.String pStringBody)
          makeCstringWithTrailing0static: Same as makeCstringWithTrailing0 except that this is a static method.
static java.lang.String makeFloatConstString(java.lang.String pInternedConstString, Type pType)
          makeFloatConstString: //##21 Make the string representation of floating constant in the form of source language constant.
static java.lang.String makeIntConstString(java.lang.String pInternedConstString, Type pType)
          makeIntConstString: //##20 Make the string representation of integer constant in the form of source language constant.
 java.lang.String makeStringBody(java.lang.String pSourceString)
          makeStringBody: Make internal representation of string (pure string) from its source program representation which may differ by source language.
 java.lang.String makeStringBodyForC(java.lang.String pCstring)
          makeStringBodyForC: Make internal representation of a string (pure string) from its C language string representation.
static java.lang.String makeStringBodyForCstatic(java.lang.String pCstring)
          makeStringBodyForCstatic: Same as makeStringBodyForC except that this is a static method.
static java.lang.String makeStringBodyStatic(java.lang.String pSourceString)
          makeStringBodyStatic: Same as makeStringBody except that this is a static method.
 
Methods inherited from class coins.SourceLanguage
evaluateAdd, evaluateAnd, evaluateCast, evaluateCondition, evaluateDiv, evaluateMod, evaluateMult, evaluateNeg, evaluateNot, evaluateOr, evaluateRelation, evaluateShiftLl, evaluateShiftRa, evaluateShiftRl, evaluateSub, evaluateXor, getFunctionsWithoutSideEffect, numberOfAddressingUnitsForCharString, numberOfAddressingUnitsForShortArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REDEFINABLE

public static final int[][] REDEFINABLE

CONVERTIBLE

public static final int[][] CONVERTIBLE

subscriptWithIndex

public static final boolean subscriptWithIndex
subscriptWithIndex: Temporal parameter to be removed. true: generate subs exp of HIR with index operand. false: generate subs exp of HIR without index operand.

See Also:
Constant Field Values
Constructor Detail

SourceLanguageFortran

public SourceLanguageFortran(SymRoot pSymRoot)
Method Detail

isC

public static boolean isC()
isC:

Returns:
true if the source language is C, false otherwise.

isFortran

public static boolean isFortran()
isFortran:

Returns:
true if the source language is FORTRAN, false otherwise.

makeStringBody

public java.lang.String makeStringBody(java.lang.String pSourceString)
makeStringBody: Make internal representation of string (pure string) from its source program representation which may differ by source language. Pure string means string body which does not contain enclosing quotation marks that may be requested by source language, and in which, a pair of escape character and special character is changed to the special character itself. In C language, trailing \0 is not included in the string body. //##47

Overrides:
makeStringBody in class SourceLanguage
Returns:
internal representation of string literal excluding heading/trailing quotes and escape characters used to represent special character.

makeStringBodyStatic

public static java.lang.String makeStringBodyStatic(java.lang.String pSourceString)
makeStringBodyStatic: Same as makeStringBody except that this is a static method.


makeStringBodyForC

public java.lang.String makeStringBodyForC(java.lang.String pCstring)
makeStringBodyForC: Make internal representation of a string (pure string) from its C language string representation. Escape characters are processed to represent proper character code.

Overrides:
makeStringBodyForC in class SourceLanguage
Returns:
internal representation of string literal excluding quotes and escape characters.

makeStringBodyForCstatic

public static java.lang.String makeStringBodyForCstatic(java.lang.String pCstring)
makeStringBodyForCstatic: Same as makeStringBodyForC except that this is a static method.


makeCstring

public java.lang.String makeCstring(java.lang.String pStringBody)
makeCstring: Change the pure string pStringBody to C string representation adding heading, trailing quotations and escape characters if required. (See makeStringBody.) Trailing \0 is not added as printable character. See makeCstringWithTrailing0

Overrides:
makeCstring in class SourceLanguage
Returns:
the string changed in C form.

makeCstringStatic

public static java.lang.String makeCstringStatic(java.lang.String pStringBody)
makeCstringStatic: Same as makeCstring except that this is a static method.


makeCstringWithTrailing0

public java.lang.String makeCstringWithTrailing0(java.lang.String pStringBody)
makeCstringWithTrailing0: Change the pure string pStringBody to C string representation adding heading, trailing quotations and escape characters if required. (See makeStringBody.) Trailing \0 is added as printable character with escape char. See makeCstringWithTrailing0

Overrides:
makeCstringWithTrailing0 in class SourceLanguage
Returns:
the string changed in C form with trailing \0 as printable character.

makeCstringWithTrailing0static

public static java.lang.String makeCstringWithTrailing0static(java.lang.String pStringBody)
makeCstringWithTrailing0static: Same as makeCstringWithTrailing0 except that this is a static method.


getSourceStringConst

public java.lang.String getSourceStringConst(java.lang.String pStringBody)
getSourceStringConst: Change the pure string pStringBody to a string constant in source language. (See makeStringBody.) If the source language is C then return the string constant in C form. See makeCstringWithTrailing0

Overrides:
getSourceStringConst in class SourceLanguage
Returns:
the string changed to the form of source language string constant.

getStringLength

public int getStringLength(java.lang.String pStringBody)
getSourceStringConstStatic: Same as getSourceStringConst except that this is a static method. public static String getSourceStringConstStatic( String pStringBody ) { return makeCstringWithTrailing0static(pStringBody); } /** getStringLength: Get the length of string constant.

Overrides:
getStringLength in class SourceLanguage
Returns:
the length of pStringBody. In C language, trailing \0 is counted as 1.

makeIntConstString

public static java.lang.String makeIntConstString(java.lang.String pInternedConstString,
                                                  Type pType)
makeIntConstString: //##20 Make the string representation of integer constant in the form of source language constant. For C language, supply L for long int, UL for unsigned long int, U for unsigned int, U for unsigned short, LL for long long int, ULL for unsigned long long int //##21 if the last character of given constant is a digit.

Returns:
the resultant constant in interned string form.

getPureIntString

public static java.lang.String getPureIntString(java.lang.String pInternedName)
getPureIntString: //##20 Get the string representation of integer constant composed of only digits. For C language, peal off trailing U, u, L, l, UL, ul, ULL, ull. //##21

Returns:
the resultant constant in interned string form.

makeFloatConstString

public static java.lang.String makeFloatConstString(java.lang.String pInternedConstString,
                                                    Type pType)
makeFloatConstString: //##21 Make the string representation of floating constant in the form of source language constant. For C language, supply D for double, F for float, if the last character of given constant is a digit or period.

Returns:
the resultant constant in interned string form.

getPureFloatString

public static java.lang.String getPureFloatString(java.lang.String pInternedName)
getPureFloatString: //##21 Get the string representation of floating constant without language specific suffix. For C language, peal off trailing F and D.

Returns:
the resultant constant in interned string form.

baseTypeOrigin

public Type baseTypeOrigin(Type pBaseType)
baseTypeOrigin: get origin of given base type pBaseType.

Overrides:
baseTypeOrigin in class SourceLanguage
Returns:
the origin type of pBaseType.

isMainProgram

public boolean isMainProgram(Subp pSubp)
isMainProgram:

Overrides:
isMainProgram in class SourceLanguage
Returns:
true if pSubp is a main program, false otherwise.

initiateFunctionsWithoutSideEffect

public void initiateFunctionsWithoutSideEffect()
Description copied from class: SourceLanguage
Set the names of functions without side effect. This may be overridden by defining a function having the same name in SourceLanguage corresponding to the language to be processed.

Overrides:
initiateFunctionsWithoutSideEffect in class SourceLanguage