scale.frontend.c
Class C99

java.lang.Object
  extended by scale.frontend.Parser
      extended by scale.frontend.c.C99

public class C99
extends Parser

This is the parser for the C99 version of C.

$Id: C99.java,v 1.24 2007-09-20 18:49:43 burrill Exp $

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


Field Summary
static int ANSIC
          Strict ANSI C mode.
static int C99
          C99 mode.
static int GCC
          GCC mode.
static int LINENUMS
          Generate line numbers.
 
Fields inherited from class scale.frontend.Parser
extension, top
 
Constructor Summary
C99(Scale top, java.lang.String extension)
           
 
Method Summary
 SourceLanguage getSourceLanguage()
          Return the correct source langauge instance for this parser.
 CallGraph parse(java.lang.String name, Suite suite, Vector<java.lang.String> macroText)
          Parse the specified C file.
static void runPreprocessor(java.io.PrintStream out, java.lang.String filename, Scale top)
          Run just the C preprocessor.
 
Methods inherited from class scale.frontend.Parser
getParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GCC

public static final int GCC
GCC mode.

See Also:
Constant Field Values

C99

public static final int C99
C99 mode.

See Also:
Constant Field Values

ANSIC

public static final int ANSIC
Strict ANSI C mode.

See Also:
Constant Field Values

LINENUMS

public static final int LINENUMS
Generate line numbers.

See Also:
Constant Field Values
Constructor Detail

C99

public C99(Scale top,
           java.lang.String extension)
Parameters:
top - is the top level of the compiler
extension - is the file extension of the file to be parsed
Method Detail

parse

public CallGraph parse(java.lang.String name,
                       Suite suite,
                       Vector<java.lang.String> macroText)
Parse the specified C file. If macroText is not null, the set of defined macros is added to it.

Specified by:
parse in class Parser
Parameters:
name - the name of the Clef AST (i.e., the file name)
suite - is the collection of call graphs
macroText - is null or is used to collect macro definitions as text strings
Returns:
new CallGraph

runPreprocessor

public static void runPreprocessor(java.io.PrintStream out,
                                   java.lang.String filename,
                                   Scale top)
                            throws java.io.IOException
Run just the C preprocessor. Each line of the specified file is read, processed, and printed on the specified print stream.

Throws:
java.io.IOException

getSourceLanguage

public SourceLanguage getSourceLanguage()
Return the correct source langauge instance for this parser.

Specified by:
getSourceLanguage in class Parser