ctrump/parser/CFront.cpp File Reference

#include <antlr/CommonAST.hpp>
#include <antlr/AST.hpp>
#include <antlr/ASTFactory.hpp>
#include "CLexer.hpp"
#include "CParser.hpp"
#include "AstConverter.hpp"
#include "CToken.hpp"
#include "LocationNode.hpp"
#include "ctrump/ctrump.h"
#include "ctrump/ast/abi.h"
#include "ctrump/io/pretty-printer.h"
#include "cfront.h"
#include <fstream>
#include <iostream>

Include dependency graph for CFront.cpp:

Go to the source code of this file.

Functions

void makeTargetInfo (const ctrump_abi *abi, TargetInfo &info)
void setInternalError (Logs &logs, const char *message, const Location *loc, const char *originalFilename)
void convertLogs (Logs &logs, struct ctrump_loginfo **log_info, int *num_log_info, struct ctrump_mempool *tree_pool)
int ctrump_parse (struct ctrump_loginfo **log_info, int *num_log_info, struct ctrump_translation_unit *result, const char *filename, const char *original_filename, struct ctrump_type_env *type_env, const struct ctrump_abi *abi, const struct ctrump_parser_option *option, int id_base, struct ctrump_mempool *tree_pool)
void ctrump_get_default_parser_option (struct ctrump_parser_option *option)


Function Documentation

void convertLogs ( Logs &  logs,
struct ctrump_loginfo **  log_info,
int *  num_log_info,
struct ctrump_mempool tree_pool 
)

Definition at line 98 of file CFront.cpp.

References ctrump_mempool_alloc.

Referenced by ctrump_parse().

void ctrump_get_default_parser_option ( struct ctrump_parser_option option  ) 

Set the default options.

Parameters:
[out] option 

Definition at line 219 of file CFront.cpp.

References ctrump_parser_option::is_vector_keyword, and ctrump_parser_option::tab_width.

Referenced by ctrump_indent(), ctrump_prog_file2pprint_format(), and parserOption_Init().

int ctrump_parse ( struct ctrump_loginfo **  log_info,
int *  num_log_info,
struct ctrump_translation_unit result,
const char *  filename,
const char *  original_filename,
struct ctrump_type_env type_env,
const struct ctrump_abi abi,
const struct ctrump_parser_option option,
int  id_base,
struct ctrump_mempool tree_pool 
)

Parsing function that creates ctrump AST nodes.

Parameters:
[out] log_info The array of ctrump_loginfo that holds parsing errors.
[out] num_log_info The number of log_info.
[out] result Parsing result AST.
[in] filename Input file name. Usually the preprocessed temporary file name.
[in] original_filename The file name before preprocessed.
[in] type_env The type environment of ctrump.
[in] abi Target type information.
[in] option Compiler options.
[in] id_base The start ID of the AST nodes.
[in] tree_pool AST node allocator.
Returns:
The node ID that will be set to the next created node, or -1 if error occurred.

Definition at line 109 of file CFront.cpp.

References convertLogs(), ctrump_init_all(), ERROR_BASIC, CToken::factory(), ctrump_translation_unit::filename, cfront::InternalError::getLocation(), cfront::InternalError::getMessage(), cfront::CAnalyzer::initialize(), ctrump_parser_option::is_vector_keyword, makeTargetInfo(), cfront::CAnalyzer::setASTFactory(), setInternalError(), cfront::CAnalyzer::setLogs(), cfront::CAnalyzer::setSupportVectorExtension(), and cfront::CAnalyzer::setTargetInfo().

Referenced by cfront_parse(), ctrump_indent(), and ctrump_prog_file2pprint_format().

void makeTargetInfo ( const ctrump_abi abi,
TargetInfo info 
)

void setInternalError ( Logs &  logs,
const char *  message,
const Location loc,
const char *  originalFilename 
)


Generated on Tue Mar 31 20:19:25 2009 for ctrump by  doxygen 1.5.6