|
const cpp_token * | next () |
|
const cpp_token * | peek (unsigned=1) |
|
const cpp_token * | peek_ident (const char *=NULL, unsigned=1) |
|
const cpp_token * | expect (enum cpp_ttype) |
|
const cpp_token * | eat_token (enum cpp_ttype) |
|
const char * | get_string () |
|
const char * | get_ident () |
|
const cpp_token * | eat_ident (const char *) |
|
const char * | get_number () |
|
unsigned | get_internal_capture_id () |
|
id_base * | parse_operation (unsigned char &) |
|
operand * | parse_capture (operand *, bool) |
|
operand * | parse_expr () |
|
c_expr * | parse_c_expr (cpp_ttype) |
|
operand * | parse_op () |
|
void | record_operlist (location_t, user_id *) |
|
void | parse_pattern () |
|
operand * | parse_result (operand *, predicate_id *) |
|
void | push_simplify (simplify::simplify_kind, vec< simplify * > &, operand *, operand *) |
|
void | parse_simplify (simplify::simplify_kind, vec< simplify * > &, predicate_id *, operand *) |
|
void | parse_for (location_t) |
|
void | parse_if (location_t) |
|
void | parse_predicates (location_t) |
|
void | parse_operator_list (location_t) |
|
void | finish_match_operand (operand *) |
|
◆ parser()
parser::parser |
( |
cpp_reader * | r_, |
|
|
bool | gimple_ ) |
Main entry of the parser. Repeatedly parse outer control structures.
parser's ctor.
References active_fors, active_ifs, capture_ids, gimple, last_id, next(), NULL, oper_lists, oper_lists_set, parse_pattern(), parsing_match_operand, r, simplifiers, user_predicates, and vNULL.
◆ eat_ident()
const cpp_token * parser::eat_ident |
( |
const char * | s | ) |
|
|
private |
◆ eat_token()
const cpp_token * parser::eat_token |
( |
enum cpp_ttype | tk | ) |
|
|
private |
◆ expect()
const cpp_token * parser::expect |
( |
enum cpp_ttype | tk | ) |
|
|
private |
◆ finish_match_operand()
void parser::finish_match_operand |
( |
operand * | op | ) |
|
|
private |
◆ get_ident()
const char * parser::get_ident |
( |
| ) |
|
|
private |
◆ get_internal_capture_id()
unsigned parser::get_internal_capture_id |
( |
| ) |
|
|
private |
◆ get_number()
const char * parser::get_number |
( |
| ) |
|
|
private |
Read the next token from R and assert it is of type CPP_NUMBER and
return its value.
References expect().
Referenced by parse_capture().
◆ get_string()
const char * parser::get_string |
( |
| ) |
|
|
private |
Read the next token from R and assert it is of type CPP_STRING and
return its value.
References expect().
◆ next()
const cpp_token * parser::next |
( |
| ) |
|
|
private |
◆ parse_c_expr()
c_expr * parser::parse_c_expr |
( |
cpp_ttype | start | ) |
|
|
private |
Lex native C code delimited by START recording the preprocessing tokens
for later processing.
c_expr = ('{'|'(') <pp token>... ('}'|')')
References c_expr::c_expr(), capture_ids, c_expr::code, eat_token(), end(), fatal_at(), gcc_unreachable, get_operator(), next(), c_expr::nr_stmts, r, and vNULL.
Referenced by parse_if(), parse_op(), and parse_result().
◆ parse_capture()
◆ parse_expr()
class operand * parser::parse_expr |
( |
| ) |
|
|
private |
Parse an expression
expr = '(' <operation>[capture][flag][type] <operand>... ')'
References expr::append_op(), commutative_op(), eat_token(), expr::expr_type, fatal_at(), expr::force_leaf, expr::force_single_use, get_ident(), get_internal_capture_id(), id_base::id, expr::is_commutative, expr::match_phi, id_base::nargs, NULL, expr::operation, expr::ops, expr::opt_grp, parse_capture(), parse_op(), parse_operation(), parsing_match_operand, and peek().
Referenced by parse_op(), and parse_result().
◆ parse_for()
void parser::parse_for |
( |
location_t | | ) |
|
|
private |
Parsing of the outer control structures.
Parse a for expression
for = '(' 'for' <subst>... <pattern> ')'
subst = <ident> '(' <ident>... ')'
References active_fors, dyn_cast(), eat_token(), expect(), fatal_at(), get_ident(), get_operator(), id_base::hashval, i, user_id::is_oper_list, id_base::nargs, NULL, operators, parse_pattern(), peek(), peek_ident(), user_id::substitutes, vNULL, and warning_at().
Referenced by parse_pattern().
◆ parse_if()
void parser::parse_if |
( |
location_t | | ) |
|
|
private |
◆ parse_op()
class operand * parser::parse_op |
( |
| ) |
|
|
private |
Parse an operand which is either an expression, a predicate or
a standalone capture.
op = predicate | expr | c_expr | capture
References dyn_cast(), eat_token(), fatal_at(), get_ident(), get_operator(), NULL, parse_c_expr(), parse_capture(), parse_expr(), parsing_match_operand, and peek().
Referenced by parse_expr(), parse_result(), and parse_simplify().
◆ parse_operation()
id_base * parser::parse_operation |
( |
unsigned char & | opt_grp | ) |
|
|
private |
Parse the operator ID, special-casing convert?, convert1? and
convert2?
References active_fors, dyn_cast(), eat_token(), fatal_at(), free(), get_ident(), get_operator(), user_id::is_oper_list, NULL, parsing_match_operand, peek(), and record_operlist().
Referenced by parse_expr().
◆ parse_operator_list()
void parser::parse_operator_list |
( |
location_t | | ) |
|
|
private |
◆ parse_pattern()
void parser::parse_pattern |
( |
| ) |
|
|
private |
Parse outer control structures.
pattern = <preds>|<for>|<if>|<simplify>|<match>
References active_fors, active_ifs, add_predicate(), expr::append_op(), capture_ids, dyn_cast(), eat_token(), fatal_at(), get_ident(), get_operator(), simplify::MATCH, predicate_id::matchers, id_base::nargs, NULL, expr::ops, parse_capture(), parse_for(), parse_if(), parse_operator_list(), parse_predicates(), parse_simplify(), peek(), simplifiers, simplify::SIMPLIFY, and user_predicates.
Referenced by parse_for(), parse_if(), and parser().
◆ parse_predicates()
void parser::parse_predicates |
( |
location_t | | ) |
|
|
private |
◆ parse_result()
Parse
<result-op> = <op> | <if> | <with>
<if> = '(' 'if' '(' <c-expr> ')' <result-op> ')'
<with> = '(' 'with' '{' <c-expr> '}' <result-op> ')'
and return it.
References as_a(), if_expr::cond, eat_ident(), eat_token(), if_expr::falseexpr, fatal_at(), c_expr::nr_stmts, parse_c_expr(), parse_expr(), parse_op(), parse_result(), peek(), peek_ident(), with_expr::subexpr, if_expr::trueexpr, and with_expr::with.
Referenced by parse_result(), and parse_simplify().
◆ parse_simplify()
Parse
simplify = 'simplify' <expr> <result-op>
or
match = 'match' <ident> <expr> [<result-op>]
and fill SIMPLIFIERS with the results.
References active_ifs, as_a(), capture_ids, if_expr::cond, fatal_at(), finish_match_operand(), i, is_a(), operand::location, NULL, operand::OP_CAPTURE, operand::OP_EXPR, oper_lists, oper_lists_set, parse_op(), parse_result(), parsing_match_operand, peek(), push_simplify(), simplifiers, if_expr::trueexpr, operand::type, and vNULL.
Referenced by parse_pattern().
◆ peek()
const cpp_token * parser::peek |
( |
unsigned | num = 1 | ) |
|
|
private |
Peek at the next non-whitespace token from R.
References fatal_at(), i, and r.
Referenced by eat_ident(), parse_capture(), parse_expr(), parse_for(), parse_if(), parse_op(), parse_operation(), parse_operator_list(), parse_pattern(), parse_predicates(), parse_result(), parse_simplify(), and peek_ident().
◆ peek_ident()
const cpp_token * parser::peek_ident |
( |
const char * | id = NULL, |
|
|
unsigned | num = 1 ) |
|
private |
◆ push_simplify()
◆ record_operlist()
void parser::record_operlist |
( |
location_t | loc, |
|
|
user_id * | p ) |
|
private |
◆ active_fors
◆ active_ifs
◆ capture_ids
◆ gimple
◆ last_id
◆ oper_lists
◆ oper_lists_set
◆ parsing_match_operand
bool parser::parsing_match_operand |
◆ simplifiers
◆ user_predicates
The documentation for this class was generated from the following files: