scale.frontend.c
Class SourceC

java.lang.Object
  extended by scale.frontend.SourceLanguage
      extended by scale.frontend.c.SourceC

public class SourceC
extends SourceLanguage

A class which defines source language characteristics for C.

$Id: SourceC.java,v 1.1 2006-12-05 21:02:08 burrill Exp $

Copyright 2006 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

The compiler uses these methods to generate valid code for C programs.


Field Summary
 
Fields inherited from class scale.frontend.SourceLanguage
cColumnMajor, cGarbageCollected, cInsensitive, cRowMajor, cSensitive, cUserManaged
 
Constructor Summary
SourceC()
           
 
Method Summary
 int arrayIndexOrigin()
          C arrays start at index 0.
 boolean arrayOrdering()
          C arrays are laid out in row major order.
 java.lang.String getLanguageId()
          Return the string associated with this source language.
 boolean mainFunction()
          C defines the Main function to be the routine "main".
 boolean nameMangle()
          C does not mangle names.
 ParameterMode parameterPassing(Type t)
          C parameters are passed by value.
 
Methods inherited from class scale.frontend.SourceLanguage
classFieldOrderMatters, isCaseSensitive, isFortran, isMemUserManaged, mathodOrderMatters, recordFieldOrdermatters, setClassFieldOrderRule, setIdentifierCase, setMemoryManagement, setMethodsRule, setRecordFieldOrderRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceC

public SourceC()
Method Detail

arrayOrdering

public boolean arrayOrdering()
C arrays are laid out in row major order.

Specified by:
arrayOrdering in class SourceLanguage
Returns:
cRowMajor

arrayIndexOrigin

public int arrayIndexOrigin()
C arrays start at index 0.

Specified by:
arrayIndexOrigin in class SourceLanguage
Returns:
0

parameterPassing

public ParameterMode parameterPassing(Type t)
C parameters are passed by value.

Specified by:
parameterPassing in class SourceLanguage
Parameters:
t - the parameter's type is ignored.
Returns:
pass by value.
See Also:
FormalDecl

nameMangle

public boolean nameMangle()
C does not mangle names.

Specified by:
nameMangle in class SourceLanguage
Returns:
false

mainFunction

public boolean mainFunction()
C defines the Main function to be the routine "main".

Specified by:
mainFunction in class SourceLanguage
Returns:
true

getLanguageId

public java.lang.String getLanguageId()
Description copied from class: SourceLanguage
Return the string associated with this source language.

Specified by:
getLanguageId in class SourceLanguage
Returns:
the LanguageId associated with this source language