#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>
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) |
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.
[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.
[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. |
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 | |||
) |
Definition at line 52 of file CFront.cpp.
References ctrump_abi::alignof_bool, ctrump_abi::alignof_double, ctrump_abi::alignof_enum, ctrump_abi::alignof_float, ctrump_abi::alignof_int, ctrump_abi::alignof_long, ctrump_abi::alignof_longlong, ctrump_abi::alignof_pointer, ctrump_abi::alignof_short, ctrump_abi::alignof_vector, cfront::TargetInfo::setAlign(), cfront::TargetInfo::setSize(), ctrump_abi::sizeof_bool, ctrump_abi::sizeof_double, ctrump_abi::sizeof_enum, ctrump_abi::sizeof_float, ctrump_abi::sizeof_int, ctrump_abi::sizeof_long, ctrump_abi::sizeof_longlong, ctrump_abi::sizeof_pointer, ctrump_abi::sizeof_short, and ctrump_abi::sizeof_vector.
Referenced by ctrump_parse().
void setInternalError | ( | Logs & | logs, | |
const char * | message, | |||
const Location * | loc, | |||
const char * | originalFilename | |||
) |
Definition at line 82 of file CFront.cpp.
References cfront::Location::column, ERROR_BASIC, cfront::Location::filePath, and cfront::Location::line.
Referenced by ctrump_parse().