coins
クラス SourceLanguageC

java.lang.Object
  |
  +--coins.SourceLanguage
        |
        +--coins.SourceLanguageC

public class SourceLanguageC
extends SourceLanguage

SourceLanguageC 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.


フィールドの概要
static int[][] CONVERTIBLE
           
static int[][] REDEFINABLE
           
static boolean subscriptWithIndex
          subscriptWithIndex: Temporal parameter to be removed.
 
クラス coins.SourceLanguage から継承したフィールド
functionsWithoutSideEffect, symRoot
 
コンストラクタの概要
SourceLanguageC(SymRoot pSymRoot)
           
 
メソッドの概要
 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. public static String getSourceStringConstStatic( String pStringBody ) { return makeCstringWithTrailing0static(pStringBody); } /** getStringLength: Get the length of string constant.
 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.
 
クラス coins.SourceLanguage から継承したメソッド
evaluateAdd, evaluateAnd, evaluateCast, evaluateCondition, evaluateDiv, evaluateMod, evaluateMult, evaluateNeg, evaluateNot, evaluateOr, evaluateRelation, evaluateShiftLl, evaluateShiftRa, evaluateShiftRl, evaluateSub, evaluateXor, getFunctionsWithoutSideEffect, numberOfAddressingUnitsForCharString, numberOfAddressingUnitsForShortArray
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

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.

関連項目:
定数フィールド値
コンストラクタの詳細

SourceLanguageC

public SourceLanguageC(SymRoot pSymRoot)
メソッドの詳細

isC

public static boolean isC()
isC:

戻り値:
true if the source language is C, false otherwise.

isFortran

public static boolean isFortran()
isFortran:

戻り値:
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

オーバーライド:
クラス SourceLanguage 内の makeStringBody
戻り値:
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.

オーバーライド:
クラス SourceLanguage 内の makeStringBodyForC
戻り値:
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

オーバーライド:
クラス SourceLanguage 内の makeCstring
戻り値:
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

オーバーライド:
クラス SourceLanguage 内の makeCstringWithTrailing0
戻り値:
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

オーバーライド:
クラス SourceLanguage 内の getSourceStringConst
戻り値:
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.

オーバーライド:
クラス SourceLanguage 内の getStringLength
戻り値:
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.

戻り値:
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

戻り値:
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.

戻り値:
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.

戻り値:
the resultant constant in interned string form.

baseTypeOrigin

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

オーバーライド:
クラス SourceLanguage 内の baseTypeOrigin
戻り値:
the origin type of pBaseType.

isMainProgram

public boolean isMainProgram(Subp pSubp)
isMainProgram:

オーバーライド:
クラス SourceLanguage 内の isMainProgram
戻り値:
true if pSubp is a main program, false otherwise.

initiateFunctionsWithoutSideEffect

public void initiateFunctionsWithoutSideEffect()
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.

オーバーライド:
クラス SourceLanguage 内の initiateFunctionsWithoutSideEffect