aboutsummaryrefslogtreecommitdiff
path: root/gcc/treelang/lex.l
AgeCommit message (Collapse)AuthorFilesLines
2004-08-08Make-lang.in (TREE_BE_LIBS): Remove.James A. Morrison1-1/+4
treelang: 2004-08-01 James A. Morrison <phython@gcc.gnu.org> * Make-lang.in (TREE_BE_LIBS): Remove. (tree1): Depend on BACKEND and LIBDEPS. Use BACKEND and LIBS instead of TREE_BE_LIBS. * parse.y: Add variable_defs_opt before statements_opt. Use tree_code_get_type instead of get_type_for_numeric_type. Reformat long lines. (parameters_opt): New rule. (function_prototype): Use parameters_opt. (return): Remove calls to print_token in error cases. Use VOID_TYPE. (check_type_match): Use VOID_TYPE. * lex.l (update_lineno_charno): Ensure INPUT_LINE starts at 1. * tree1.c: Include version.h and cgraph.h (treelang_parse_file): Call cgraph_finalize_compilation_unit and cgraph_optimize. * treelang.h (item): Remove extraneous GTY. * treetree.h (get_type_for_numeric_type): Remove. * treetree.c: Include tree-dump.h, tree-iterator.h, tree-gimple.h, function.h, and cgraph.h. Don't include rtl.h (keep_level_p): Remove. (tree_push_atomic_type_decl): Remove. (get_type_for_numeric_type): Remove. (tree_code_get_numeric_type): Remove. (global_bindings_p): Make static. (getdecls): Likewise. (insert_block): Likewise. (tree_code_if_start): Create a COND_EXPR and add it to the tree instead of creating rtl. (tree_code_if_else): Create a BIND_EXPR if any variables were created in the if statement. (tree_code_end_if): Likewise. (tree_code_create_function_prototype): Use tree_code_get_type. Don't use SET_DECL_ASSEMBLER_NAME. (tree_code_create_function_initial): Set DECL_ARTIFICIAL and DECL_IGNORING_P on RESULT_DECL. Use tree_code_get_type. Don't call layout_decl on RESULT_DECL. Don't call rtl expand functions. (tree_code_create_function_wrapup): Don't call rtl expand functions. Create a BIND_EXPR for each function. Dump original and gimplified copies of the function tree. Gimplify function. (tree_code_create_variable): Use tree_code_get_type. Don't call layout_decl or expand_decl. Fold CONVERT_EXPRs. (tree_code_generate_return): Fold CONVERT_EXPRs and MODIFY_EXPRs. Add RETURN_EXPR to the current statement list. Don't call rtl expand functions. (tree_code_output_expression_statement): Append CODE to current statement list. (tree_code_get_expression): Fold expressions. Build a pointer to a FUNCTION_TYPE intead of the called functions return type. (struct binding_level): Add statement list STMTS. (getstmtlist): New Function. (pushlevel): Make static. Allocate an empty statement list. (poplevel): Make static. Don't clear BLOCK_NODE's BLOCK_VARS. Don't use DECL_ASSEMBLER_NAME. (tree_push_type_decl): Set TYPE_NAME of TYPE_NODE to ID. (treelang_init_decl_processing): Define basic types after unused types. Don't call tree_push_atomic_type_decl. (builtin_function): Don't call make_decl_rtl. (treelang_expand_function). New Function. testsuite/treelang: * compile/vars_def.tree: New File. * compile/badreturn.tree: New File. From-SVN: r85684
2003-12-04Patch from James MorrisonJames A. Morrison1-1/+1
* lex.l: Add \t as a whitespace character. * treelang.texi (Lexical Syntax): Document a tab as whitespace. From-SVN: r74311
2003-05-06Make-lang.in (treelang/tree1.o): Depends on input.hNathan Sidwell1-8/+8
treelang: * Make-lang.in (treelang/tree1.o): Depends on input.h (treelang/treetree.o, treelang/parse.o, treelang/lex.o): Likewise. * treelang.h: #include input.h. (in_fname): Remove. (struct token_part): Remove lineno, add location. * lex.l (next_tree_lineno): Remove. (update_lineno_charno): Adjust. (dump_lex_value): Adjust. * parse.y (variable_def, function_prototype, function, statement, if_statement, return, function_invocation, variable_ref): Adjust. (print_token, yyerror, ensure_not_void): Adjust. tree1.c (in_fname): Remove. (treelang_init): Setup input_location. (lookup_tree_name): Adjust. (insert_tree_name): Adjust. * treetree.c (tree_code_if_start): Replace filename and lineno parms with loc. Adjust. (tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_function_wrapup, tree_code_create_variable, tree_code_output_expression_statement): Likewise. * treetree.h (tree_code_if_start): Replace filename and lineno parms with loc. (tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_function_wrapup, tree_code_create_variable, tree_code_output_expression_statement): Likewise. From-SVN: r66519
2003-03-01Fix for bison 1.75 enum name clash.Tim Josling1-3/+3
From-SVN: r63606
2003-03-01Treelang fixes.Tim Josling1-3/+3
From-SVN: r63604
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-11/+6
From-SVN: r60174
2002-06-19Clean up configure.in checks for bad languages; fix typos in treelang.Tim Josling1-1/+1
From-SVN: r54800
2002-06-10Fixes to make treelang worg with PCH gengtype.c changes.Tim Josling1-24/+21
From-SVN: r54425
2002-05-05Added new sample language treelang.Tim Josling1-0/+294
From-SVN: r53169