Intel SPMD Program Compiler  1.3.0
Public Member Functions | Public Attributes
PrintStmt Class Reference

Representation of a print() statement in the program. More...

#include <stmt.h>

Inheritance diagram for PrintStmt:
Inheritance graph
[legend]
Collaboration diagram for PrintStmt:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PrintStmt (const std::string &f, Expr *v, SourcePos p)
void EmitCode (FunctionEmitContext *ctx) const
void Print (int indent) const
StmtTypeCheck ()
int EstimateCost () const

Public Attributes

const std::string format
Exprvalues

Detailed Description

Representation of a print() statement in the program.

It's currently necessary to have a special statement type for print() since strings aren't supported as first-class types in the language, but we need to be able to pass a formatting string as the first argument to print(). We also need this to be a variable argument function, which also isn't supported. Representing print() as a statement lets us work around both of those ugly little issues...

Definition at line 456 of file stmt.h.


Constructor & Destructor Documentation

PrintStmt::PrintStmt ( const std::string &  f,
Expr v,
SourcePos  p 
)

Definition at line 2933 of file stmt.cpp.


Member Function Documentation

void PrintStmt::EmitCode ( FunctionEmitContext ctx) const [virtual]
int PrintStmt::EstimateCost ( ) const

Definition at line 3122 of file stmt.cpp.

References COST_FUNCALL.

void PrintStmt::Print ( int  indent) const [virtual]

Print a representation of the statement (and any children AST nodes) to standard output. This method is used for debuggins.

Implements Stmt.

Definition at line 3110 of file stmt.cpp.

References format.

Stmt * PrintStmt::TypeCheck ( ) [virtual]

Implements Stmt.

Definition at line 3116 of file stmt.cpp.


Member Data Documentation

const std::string PrintStmt::format

Format string for the print() statement.

Definition at line 467 of file stmt.h.

Referenced by EmitCode(), and Print().

This holds the arguments passed to the print() statement. If more than one was provided, this will be an ExprList.

Definition at line 470 of file stmt.h.

Referenced by EmitCode().


The documentation for this class was generated from the following files: