├── .gitignore
├── libc
├── .gitignore
├── Makefile
├── assert.c
├── putchar.c
├── size_t.h
├── stddef.h
├── putchar.h
├── common.h
├── unistd.h
├── getcwd.c
├── stdlib.h
├── stdarg.h
├── string.h
└── assert.h
├── test
├── extras
│ ├── .gitignore
│ ├── Makefile
│ ├── includetest2.h
│ ├── main_argv_indirect.c
│ ├── includetest1.h
│ └── extern_test.c
├── c89
│ ├── .gitignore
│ ├── Makefile
│ ├── empty-main-return-zero.c
│ ├── basic-putchar-a.c
│ ├── div-zero.c
│ ├── main_with_parameters.c
│ ├── ignore-local.c
│ ├── constants.c
│ ├── while-loop.c
│ ├── nested-putchar-a.c
│ ├── nested-putchar-a-param-ignored.c
│ ├── va_list_call.c
│ └── basic-putchar-b.c
├── c99
│ ├── .gitignore
│ ├── Makefile
│ └── snprintf_test.c
├── .gitignore
└── scripts
│ ├── throw-error-on-problems-in-test-failure-log.sh
│ └── throw-error-on-problems-in-valgrind-log.sh
├── builtin
├── .gitignore
├── Makefile
├── putchar_busy.h
├── stack.c
├── print_string.h
├── print_buff_add.h
├── print_hexadecimal.h
├── print_buff_add.c
├── print_decimal.h
├── l2
│ └── memory_mapped_registers.l2
├── print_bits.c
├── c99libc_in_c89.h
└── print_string.c
├── generated
├── .gitignore
└── README.md
├── emulators
├── javascript
│ ├── .gitignore
│ ├── chrome
│ │ └── chrome-plugin
│ │ │ ├── manifest.json
│ │ │ ├── background.js
│ │ │ └── close-chrome-tab.js
│ ├── sample-apache-config
│ └── get-available-tests
│ │ └── index.php
├── java
│ ├── .gitignore
│ └── OpCPU
│ │ └── OpCPUDataInterface.java
├── c
│ ├── .gitignore
│ ├── enum_l0_instruction_type.h
│ ├── struct_l0_item.h
│ └── enum_l0_directive_type.h
├── python
│ ├── .gitignore
│ ├── op_cpu_package
│ │ └── __init__.py
│ └── Makefile
└── Makefile
├── demos
└── brainfuck-cpp
│ ├── .gitignore
│ └── Makefile
├── recc-implementation
├── .gitignore
├── compiler_interface_phase_1.c
├── templates
│ ├── generic_type_list.h
│ ├── comparison-functions
│ │ ├── strcmp_compare.c
│ │ ├── simple_compare.h
│ │ ├── simple_compare.c
│ │ ├── type_engine_id_compare.c
│ │ ├── generic_list_item_compare.c
│ │ ├── type_engine_details_compare.c
│ │ ├── entity_relationship_compare.c
│ │ └── type_engine_scoped_type_compare.c
│ ├── generic_header_merge_sort.h
│ ├── generic_type_key_value_pair.h
│ ├── generic_header_binary_search.h
│ └── generic_type_map.h
├── compiler_interface_phase_2.h
├── compiler_interface_header_targets.h
├── struct_entity_relationship.h
├── compiler_interface_phase_1.h
├── enum_entity_relation_type.h
└── bootstrap_phase_2.c
├── kernel
├── .gitignore
├── printf_busy.h
├── level_1_page_table_entries.c
├── l2
│ ├── getchar_nobusy.l2
│ ├── putchar_nobusy.l2
│ └── putchar_busy.l2
├── main.c
├── putchar.c
└── public_kernel_interface.h
└── types
├── parser
├── enum_add_or_remove.h
├── enum_scope_type.h
├── enum_value_type.h
├── enum_declaration_or_definition.h
├── enum_object_location.h
├── struct_parser_checkpoint.h
├── enum_l2_parser_operation_type.h
├── struct_parser_operation.h
├── struct_l2_parser_operation.h
├── enum_normalized_specifier_type.h
├── struct_parser_error.h
├── struct_current_function_change.h
├── enum_normalized_declarator_type.h
├── struct_namespace_object_change.h
├── struct_parser_node.h
├── struct_l2_parser_node.h
├── struct_first_and_last_namespace_object.h
├── struct_normalized_declarator.h
├── enum_normalized_declaration_type.h
├── struct_normalized_specifier.h
├── struct_constant_description.h
├── struct_l2_parser_state.h
├── struct_namespace_modification.h
├── enum_type_class.h
├── enum_parser_operation_type.h
└── struct_normalized_declaration_element.h
├── code_generator
├── enum_copy_method.h
├── struct_switch_frame.h
├── struct_compile_time_constant.h
├── struct_constant_initializer_level.h
└── struct_type_traversal.h
├── preprocessor
├── enum_macro_definition_type.h
├── enum_special_macro_type.h
├── struct_preprocessor_if_branch.h
├── struct_macro_parameter.h
├── struct_special_macro_definition.h
├── struct_preprocessor_file_context.h
├── struct_preprocessor_macro_level.h
└── struct_macro_definition.h
├── type_engine
├── struct_array_part_id.h
├── struct_identifier_id.h
├── struct_general_type_id.h
├── struct_parser_node_id.h
├── struct_pointer_part_id.h
├── struct_scope_level_id.h
├── struct_declarator_part_id.h
├── struct_enum_specifier_id.h
├── struct_function_part_id.h
├── struct_parameter_list_id.h
├── struct_type_qualifier_id.h
├── struct_union_specifier_id.h
├── enum_type_engine_print_type.h
├── struct_function_definition.h
├── struct_struct_specifier_id.h
├── struct_aggregate_specifier_id.h
├── struct_scoped_tag_specifier_id.h
├── struct_bitfield_or_declarator_id.h
├── struct_general_type_list_item_id.h
├── struct_simple_type_specifier_id.h
├── struct_specifier_or_qualifier_id.h
├── struct_unscoped_tag_specifier_id.h
├── struct_declarator_part_list_item_id.h
├── struct_simple_storage_class_specifier_id.h
├── enum_type_engine_enum_specifier_kind.h
├── struct_specifier_or_qualifier_list_item_id.h
├── enum_type_engine_union_specifier_kind.h
├── enum_type_engine_function_part_kind.h
├── enum_type_engine_pointer_part_kind.h
├── enum_type_engine_struct_specifier_kind.h
├── struct_array_part_details.h
├── struct_function_part_details.h
├── struct_pointer_part_details.h
├── enum_type_engine_bitfield_or_declarator_kind.h
├── enum_type_engine_parameter_list_kind.h
├── struct_declarator_part_details.h
├── struct_enum_specifier_details.h
├── struct_identifier_from_declarator.h
├── struct_parameter_list_details.h
├── struct_union_specifier_details.h
├── struct_struct_specifier_details.h
├── struct_aggregate_specifier_details.h
├── enum_scope_level_type.h
├── enum_type_engine_array_part_kind.h
├── struct_bitfield_or_declarator_details.h
├── struct_function_definition_collection.h
├── struct_specifier_or_qualifier_details.h
├── struct_unscoped_tag_specifier_details.h
├── struct_enum_definition.h
├── enum_type_engine_aggregate_specifier_kind.h
├── enum_type_engine_general_type_list_item_kind.h
├── struct_scoped_tag_specifier_details.h
├── enum_type_engine_declarator_part_kind.h
├── enum_type_engine_declarator_part_list_item_kind.h
├── enum_type_engine_specifier_or_qualifier_kind.h
├── enum_type_engine_unscoped_tag_specifier_kind.h
├── struct_general_type_details.h
├── enum_type_engine_specifier_or_qualifier_list_item_kind.h
├── struct_general_type_list_item_details.h
├── struct_declarator_part_list_item_details.h
├── struct_struct_or_union_definition.h
├── struct_specifier_or_qualifier_list_item_details.h
└── struct_identifier_declaration_namespace.h
├── builtin
└── struct_printing_state.h
├── linker
├── enum_relocation_type.h
├── struct_linker_region.h
├── struct_start_end.h
└── struct_linker_object.h
├── l0_generator
├── enum_l0_language_type.h
└── struct_l0_generator_state.h
├── lexer
├── struct_c_lexer_state.h
├── struct_l2_lexer_state.h
├── struct_c_lexer_token.h
├── struct_l2_lexer_token.h
└── struct_common_lexer_state.h
├── regex_engine
├── struct_regex_match.h
├── struct_character_class_range.h
├── struct_regex_compiler_error.h
├── struct_regex_parser_node.h
├── enum_regex_compiler_error_type.h
├── enum_regex_computation_node_type.h
└── enum_regex_parser_node_type.h
└── recc-implementation
├── struct_generic_list_item.h
└── enum_entity_type.h
/.gitignore:
--------------------------------------------------------------------------------
1 | /config.mak
2 | /logs
3 |
--------------------------------------------------------------------------------
/libc/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.i
3 | /*.l2
4 |
--------------------------------------------------------------------------------
/test/extras/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.l2
3 | /*.l1
4 | /*.i
5 |
--------------------------------------------------------------------------------
/builtin/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.i
3 | /*.l2
4 | /build/recc.o
5 |
--------------------------------------------------------------------------------
/generated/.gitignore:
--------------------------------------------------------------------------------
1 | /*.h
2 | /*.c
3 | /*.l2
4 | /*.o
5 | /*.i
6 |
--------------------------------------------------------------------------------
/emulators/javascript/.gitignore:
--------------------------------------------------------------------------------
1 | /chrome/data-dir/*
2 | /jquery.1.4.4.min.js
3 |
--------------------------------------------------------------------------------
/emulators/java/.gitignore:
--------------------------------------------------------------------------------
1 | /OpCPU/*.class
2 | /OpCPU/KernelData.java
3 | /build_java_example.o
4 | /build_java_example
5 |
--------------------------------------------------------------------------------
/demos/brainfuck-cpp/.gitignore:
--------------------------------------------------------------------------------
1 | /build_brainfuck_cpp_demo.o
2 | /build_brainfuck_cpp_demo
3 | /result.i
4 | /CPP_COMPLETE
5 |
--------------------------------------------------------------------------------
/emulators/c/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /linux-emulator-example-data.l0.c
3 | /linux-emulator-example
4 | /kernel.l0.c
5 | /build_c_example
6 |
--------------------------------------------------------------------------------
/generated/README.md:
--------------------------------------------------------------------------------
1 | This directory includes source files that are all automatically generated and should therefore not be modified.
2 |
--------------------------------------------------------------------------------
/emulators/python/.gitignore:
--------------------------------------------------------------------------------
1 | /op_cpu_package/*.pyc
2 | /op_cpu_package/python_l0_module.py
3 | /build_python_example
4 | /build_python_example.o
5 |
--------------------------------------------------------------------------------
/test/c89/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.l2
3 | /*.l1
4 | /*.jsoutput
5 | /*.diff
6 | /*.i
7 | /*.l0.js
8 | /*.diff
9 | /*.output
10 | /*.exec
11 |
--------------------------------------------------------------------------------
/test/c99/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.l2
3 | /*.l1
4 | /*.jsoutput
5 | /*.diff
6 | /*.i
7 | /*.l0.js
8 | /*.diff
9 | /*.output
10 | /*.exec
11 |
--------------------------------------------------------------------------------
/emulators/Makefile:
--------------------------------------------------------------------------------
1 | include emulators/python/Makefile
2 | include emulators/c/Makefile
3 | include emulators/java/Makefile
4 |
5 | clean-emulators: clean-c-emulator clean-java-emulator clean-python-emulator
6 |
--------------------------------------------------------------------------------
/recc-implementation/.gitignore:
--------------------------------------------------------------------------------
1 | /*.o
2 | /*.l2
3 | /*.i
4 | /librecc.a
5 | /filesystem_impl.l2
6 | /bootstrap_phase_1
7 | /bootstrap_phase_2
8 | /object-data-structures
9 | /file-dependencies-data-structures
10 | /library-data-structures
11 | /libdata-structures.l2
12 |
--------------------------------------------------------------------------------
/test/.gitignore:
--------------------------------------------------------------------------------
1 | /custom_build_targets.c
2 | /build_tests.c
3 | /build_tests
4 | /tests_to_run
5 | /kernel.l0.py
6 | /kernel.l0.c
7 | /kernel.l0.java
8 | /kernel.l0.js
9 | /*.o
10 | /*.l2
11 | /*.l1
12 | /*.jsoutput
13 | /*.diff
14 | /*.i
15 | /*.l0.js
16 | /*.diff
17 | /*.output
18 | /*.exec
19 | /regex_engine_stress_test
20 | /parser_stress_test
21 |
--------------------------------------------------------------------------------
/test/c89/Makefile:
--------------------------------------------------------------------------------
1 | .PRECIOUS: test/c89/%.o
2 | .PRECIOUS: test/c89/%.exec
3 |
4 | C89_SOURCES=$(shell ls test/c89/*.c)
5 |
6 | test/c89/%.o: test/c89/%.c
7 | @$(HOSTCC) -c $< -o $@ $(CUSTOM_C89_FLAGS)
8 |
9 | test/c89/%.exec: test/c89/%.o $(TESTING_EXTRAS_OBJECTS) $(COMPILER_OBJECTS)
10 | @$(HOSTCC) $< $(TESTING_EXTRAS_OBJECTS) $(COMPILER_OBJECTS) -o $@ $(CUSTOM_C89_FLAGS)
11 |
12 | clean-c89-tests:
13 |
14 |
--------------------------------------------------------------------------------
/test/c99/Makefile:
--------------------------------------------------------------------------------
1 | .PRECIOUS: test/c99/%.o
2 | .PRECIOUS: test/c99/%.exec
3 |
4 | C99_SOURCES=$(shell ls test/c99/*.c)
5 |
6 | test/c99/%.o: test/c99/%.c
7 | @$(HOSTCC) -c $< -o $@ $(CUSTOM_C99_FLAGS)
8 |
9 | test/c99/%.exec: test/c99/%.o $(TESTING_EXTRAS_OBJECTS) $(COMPILER_OBJECTS)
10 | @$(HOSTCC) $< $(TESTING_EXTRAS_OBJECTS) $(COMPILER_OBJECTS) -o $@ $(CUSTOM_C99_FLAGS)
11 |
12 | clean-c99-tests:
13 |
14 |
--------------------------------------------------------------------------------
/test/scripts/throw-error-on-problems-in-test-failure-log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 | trap "echo \"Exiting from ${0} due to error signal.\"; exit 1;" ERR
5 |
6 | echo "Begin checking for problems in test failure log."
7 | # Throw an error if there is anything in the test failure log
8 | if [ $(cat logs/test-failures.log | wc -l) -ne 0 ]; then cat logs/test-failures.log; exit 1; fi
9 | echo "No problems in test failure log observed."
10 | exit 0;
11 |
--------------------------------------------------------------------------------
/test/extras/Makefile:
--------------------------------------------------------------------------------
1 | TESTING_EXTRAS_SOURCES=$(wildcard test/extras/*.c)
2 |
3 | TESTING_EXTRAS_OBJECTS=$(TESTING_EXTRAS_SOURCES:.c=.o)
4 | TESTING_EXTRAS_PREPROCESSED=$(TESTING_EXTRAS_SOURCES:.c=.i)
5 | TESTING_EXTRAS_L2=$(TESTING_EXTRAS_SOURCES:.c=.l2)
6 |
7 | test/extras/%.o: test/extras/%.c
8 | @$(HOSTCC) -c $< -o $@ $(CUSTOM_C89_FLAGS)
9 |
10 | clean-test-extras:
11 | @rm -f $(TESTING_EXTRAS_OBJECTS) $(TESTING_EXTRAS_PREPROCESSED) $(TESTING_EXTRAS_L2)
12 |
--------------------------------------------------------------------------------
/emulators/javascript/chrome/chrome-plugin/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 |
4 | "name": "Close chrome",
5 | "description": "This extension is used to close the current tab.",
6 | "version": "1.4",
7 | "permissions": ["tabs", "http://*/*"],
8 | "background": {
9 | "scripts": ["background.js"]
10 | },
11 | "content_scripts": [
12 | {
13 | "matches": ["http://*/*"],
14 | "js": ["close-chrome-tab.js"]
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/libc/Makefile:
--------------------------------------------------------------------------------
1 | libc/filesystem.h:
2 | @touch libc/filesystem.h
3 |
4 | libc/filesystem.o: libc/filesystem.c libc/filesystem.h
5 | @$(HOSTCC) -c libc/filesystem.c -o libc/filesystem.o $(CUSTOM_C89_FLAGS)
6 |
7 | $(CROSS_BUILD_PREFIX)libc/recc.o: $(CROSS_BUILD_PREFIX)libc/recc.c recc-implementation/compiler_interface_phase_3.h
8 | @$(HOSTCC) -c $(CROSS_BUILD_PREFIX)libc/recc.c -o $(CROSS_BUILD_PREFIX)libc/recc.o $(CUSTOM_C89_FLAGS)
9 |
10 | clean-stdlib:
11 | @rm -f libc/*.o libc/*.i libc/*.l2
12 |
--------------------------------------------------------------------------------
/emulators/javascript/sample-apache-config:
--------------------------------------------------------------------------------
1 |
2 | ServerAdmin webmaster@localhost
3 |
4 | DocumentRoot RECC_ROOT_FOLDER_HERE
5 |
6 | Options FollowSymLinks
7 | AllowOverride None
8 |
9 |
10 | Options Indexes FollowSymLinks MultiViews
11 | AllowOverride None
12 | Order allow,deny
13 | allow from all
14 | Require all granted
15 |
16 |
17 | ErrorLog ${APACHE_LOG_DIR}/error-recc.log
18 |
19 | LogLevel warn
20 |
21 | CustomLog ${APACHE_LOG_DIR}/access-recc.log combined
22 |
23 |
24 |
--------------------------------------------------------------------------------
/kernel/.gitignore:
--------------------------------------------------------------------------------
1 | /kernel.l1
2 | /user_proc.l2
3 | /user_proc.i
4 | /kernel_impl.i
5 | /kernel_impl.l2
6 | /kernel_state.l2
7 | /kernel_state.i
8 | /printf_busy.l2
9 | /printf_busy.i
10 | /putchar.l2
11 | /putchar.i
12 | /main.l2
13 | /main.i
14 | /filesystem.l2
15 | /filesystem.i
16 | /assert.l2
17 | /assert.i
18 | /queue.l2
19 | /queue.i
20 | /kernel.sym
21 | /kernel_symbols.sym
22 | /kernel_symbols.l1
23 | /kernel_symbols.l0.c
24 | /kernel_symbols.l0.i
25 | /kernel_symbols.l0.l2
26 | /recc.o
27 | /build_kernel
28 | /build_kernel.o
29 | /level_1_page_table_entries.i
30 | /level_1_page_table_entries.l2
31 |
--------------------------------------------------------------------------------
/builtin/Makefile:
--------------------------------------------------------------------------------
1 | BUILTIN_SOURCES=$(wildcard builtin/*.c)
2 |
3 | BUILTIN_OBJECTS=$(BUILTIN_SOURCES:.c=.o)
4 |
5 | builtin/%.o: builtin/%.c
6 | @$(HOSTCC) -c $< -o $@ $(CUSTOM_C89_FLAGS)
7 |
8 | builtin/build/recc.o: builtin/build/recc.c
9 | @$(HOSTCC) -c $< -o $@ $(CUSTOM_C89_FLAGS)
10 |
11 | $(CROSS_BUILD_PREFIX)builtin/recc.o: $(CROSS_BUILD_PREFIX)builtin/recc.c recc-implementation/compiler_interface_phase_3.h
12 | @$(HOSTCC) -c $(CROSS_BUILD_PREFIX)builtin/recc.c -o $(CROSS_BUILD_PREFIX)builtin/recc.o $(CUSTOM_C89_FLAGS)
13 |
14 | clean-builtins:
15 | @rm -f builtin/build/*.o builtin/*.i builtin/*.o builtin/*.l2
16 |
--------------------------------------------------------------------------------
/demos/brainfuck-cpp/Makefile:
--------------------------------------------------------------------------------
1 | demos/brainfuck-cpp/build_brainfuck_cpp_demo: demos/brainfuck-cpp/build_brainfuck_cpp_demo.o $(COMPILER_OBJECTS)
2 | @$(HOSTCC) -o demos/brainfuck-cpp/build_brainfuck_cpp_demo demos/brainfuck-cpp/build_brainfuck_cpp_demo.o $(COMPILER_OBJECTS) $(CUSTOM_C89_FLAGS)
3 |
4 | demos/brainfuck-cpp/build_brainfuck_cpp_demo.o: demos/brainfuck-cpp/build_brainfuck_cpp_demo.c
5 | @$(HOSTCC) -c demos/brainfuck-cpp/build_brainfuck_cpp_demo.c -o demos/brainfuck-cpp/build_brainfuck_cpp_demo.o $(CUSTOM_C89_FLAGS)
6 |
7 | clean-brainfuck-cpp:
8 | @rm -f demos/brainfuck-cpp/build_brainfuck_cpp_demo demos/brainfuck-cpp/build_brainfuck_cpp_demo.o demos/brainfuck-cpp/result.i
9 |
--------------------------------------------------------------------------------
/emulators/python/op_cpu_package/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016 Robert Elder Software Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 | # use this file except in compliance with the License. You may obtain a copy
5 | # of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 |
--------------------------------------------------------------------------------
/test/c89/empty-main-return-zero.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | int main(void){
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/libc/assert.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | /* See header for macro definition of assert */
20 |
--------------------------------------------------------------------------------
/libc/putchar.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | #include "putchar.h"
17 | int putchar(int c){
18 | return putchar_busy(c);
19 | }
20 |
--------------------------------------------------------------------------------
/libc/size_t.h:
--------------------------------------------------------------------------------
1 | #ifndef SIZE_T_H_DEFINED_
2 | #define SIZE_T_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | typedef int size_t;
19 | #endif
20 |
--------------------------------------------------------------------------------
/libc/stddef.h:
--------------------------------------------------------------------------------
1 | #ifndef STD_DEF_H_DEFINED_
2 | #define STD_DEF_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #include "size_t.h"
19 | #endif
20 |
--------------------------------------------------------------------------------
/types/parser/enum_add_or_remove.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum add_or_remove{
20 | ADD,
21 | REMOVE
22 | };
23 |
--------------------------------------------------------------------------------
/test/c89/basic-putchar-a.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int main(void){
20 | putchar('a');
21 | return 0;
22 | }
23 |
--------------------------------------------------------------------------------
/test/c89/div-zero.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | int main(void){
18 | unsigned int o = 1;
19 | unsigned int z = 0;
20 | return (int)(o / z);
21 | }
22 |
--------------------------------------------------------------------------------
/builtin/putchar_busy.h:
--------------------------------------------------------------------------------
1 | #ifndef PUTCHAR_BUSY_H_DEFINED_
2 | #define PUTCHAR_BUSY_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | int putchar_busy(int);
19 | #endif
20 |
--------------------------------------------------------------------------------
/types/code_generator/enum_copy_method.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum copy_method{
20 | ASSIGN_COPY,
21 | REF_COPY,
22 | NEW_COPY
23 | };
24 |
--------------------------------------------------------------------------------
/test/extras/includetest2.h:
--------------------------------------------------------------------------------
1 | #ifndef includetest2_h_
2 | #define includetest2_h_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | putchar('a');
20 | putchar('c');
21 | #endif
22 |
--------------------------------------------------------------------------------
/recc-implementation/compiler_interface_phase_1.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include "compiler_interface_phase_1.h"
18 |
19 | /* TODO: Nothing here right now. */
20 |
--------------------------------------------------------------------------------
/types/preprocessor/enum_macro_definition_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum macro_definition_type{
20 | OBJECT_MACRO,
21 | FUNCTION_MACRO
22 | };
23 |
--------------------------------------------------------------------------------
/types/preprocessor/enum_special_macro_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum special_macro_type{
20 | _LINE_MACRO,
21 | _FILE_MACRO
22 | };
23 |
24 |
25 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_preprocessor_if_branch.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct preprocessor_if_branch{
20 | unsigned int active;
21 | };
22 |
23 |
24 |
--------------------------------------------------------------------------------
/libc/putchar.h:
--------------------------------------------------------------------------------
1 | #ifndef PUTCHAR_H_DEFINED_
2 | #define PUTCHAR_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #include "../builtin/putchar_busy.h"
19 | int putchar(int);
20 | #endif
21 |
--------------------------------------------------------------------------------
/types/type_engine/struct_array_part_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct array_part_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_identifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct identifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/libc/common.h:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_H_DEFINED_
2 | #define COMMON_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef NULL
20 | #define NULL ((void*)0)
21 | #endif
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/types/parser/enum_scope_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum scope_type{
20 | IDENTIFIER_NAMESPACE,
21 | TAG_NAMESPACE,
22 | LABEL_NAMESPACE
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/type_engine/struct_general_type_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct general_type_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_parser_node_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parser_node_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_pointer_part_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct pointer_part_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_scope_level_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct scope_level_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_declarator_part_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct declarator_part_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_enum_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct enum_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_function_part_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct function_part_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_parameter_list_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parameter_list_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_type_qualifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct type_qualifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_union_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct union_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/builtin/stack.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | extern unsigned int _g_builtin_stack[0x40000];
18 |
19 | unsigned int _g_builtin_stack[0x40000]; /* 1048576 bytes of stack space (1MB) */
20 |
--------------------------------------------------------------------------------
/types/parser/enum_value_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum value_type{
20 | LVALUE,
21 | WORD_ALIGNED_RVALUE,
22 | MINIMAL_RVALUE
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_print_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_print_type{
20 | TYPE_ENGINE_DEBUG,
21 | TYPE_ENGINE_NORMAL
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/struct_function_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct function_definition{
22 | unsigned int i;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_struct_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct struct_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/builtin/struct_printing_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct printing_state{
20 | char * buffer;
21 | unsigned int chars_required;
22 | unsigned int buffer_size;
23 | };
24 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_macro_parameter.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct macro_parameter{
20 | unsigned int position_index;
21 | unsigned int is_variadic;
22 | };
23 |
24 |
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_aggregate_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct aggregate_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_scoped_tag_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct scoped_tag_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/linker/enum_relocation_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum relocation_type{
20 | RELOCATION_TYPE_RELOCATABLE,
21 | RELOCATION_TYPE_END,
22 | RELOCATION_TYPE_ADDRESS
23 | };
24 |
--------------------------------------------------------------------------------
/types/parser/enum_declaration_or_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum declaration_or_definition{
20 | FROM_DECLARATION,
21 | FROM_DEFINITION
22 | };
23 |
24 |
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_bitfield_or_declarator_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct bitfield_or_declarator_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_general_type_list_item_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct general_type_list_item_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_simple_type_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct simple_type_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_specifier_or_qualifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct specifier_or_qualifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_unscoped_tag_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct unscoped_tag_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/parser/enum_object_location.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum object_location{
20 | LOCATION_STRUCT,
21 | ENUM_IDENTIFIER,
22 | GLOBAL,
23 | LOCAL,
24 | PARAMETER
25 | };
26 |
27 |
28 |
--------------------------------------------------------------------------------
/types/type_engine/struct_declarator_part_list_item_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct declarator_part_list_item_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/recc-implementation/templates/generic_type_list.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct T0_IDENTIFIER_list{
22 | struct binary_exponential_buffer buffer;
23 | };
24 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_special_macro_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct special_macro_definition{
22 | enum special_macro_type type;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_simple_storage_class_specifier_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct simple_storage_class_specifier_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/types/l0_generator/enum_l0_language_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum l0_language_type {
20 | C_LANGUAGE_TYPE,
21 | JSONP_LANGUAGE_TYPE,
22 | PYTHON_LANGUAGE_TYPE,
23 | JAVA_LANGUAGE_TYPE
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_enum_specifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_enum_specifier_kind{
20 | TYPE_ENGINE_ANONYMOUS_ENUM,
21 | TYPE_ENGINE_NAMED_ENUM
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/struct_specifier_or_qualifier_list_item_id.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct specifier_or_qualifier_list_item_id{
22 | unsigned int id;
23 | };
24 |
--------------------------------------------------------------------------------
/libc/unistd.h:
--------------------------------------------------------------------------------
1 | #ifndef UNISTD_H_DEFINED_
2 | #define UNISTD_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef STDIO_H_DEFINED_
20 | #include
21 | #endif
22 |
23 | char *getcwd(char *, size_t);
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/types/parser/struct_parser_checkpoint.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 |
20 | struct parser_checkpoint{
21 | unsigned int parser_operation_checkpoint;
22 | unsigned int type_engine_checkpoint;
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_union_specifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_union_specifier_kind{
20 | TYPE_ENGINE_ANONYMOUS_UNION,
21 | TYPE_ENGINE_NAMED_UNION
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_function_part_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_function_part_kind {
20 | TYPE_ENGINE_FUNCTION_K_AND_R_C,
21 | TYPE_ENGINE_FUNCTION_PROTOTYPE
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_pointer_part_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_pointer_part_kind{
20 | TYPE_ENGINE_QUALIFIED_POINTER,
21 | TYPE_ENGINE_UNQUALIFIED_POINTER
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_struct_specifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_struct_specifier_kind{
20 | TYPE_ENGINE_ANONYMOUS_STRUCT,
21 | TYPE_ENGINE_NAMED_STRUCT
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/struct_array_part_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct array_part_details{
22 | enum type_engine_array_part_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/libc/getcwd.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | char * getcwd(char * buf, size_t max_size){
21 | assert(max_size > 5);
22 | buf[0] = '/';
23 | buf[1] = 0;
24 | return buf;
25 | }
26 |
--------------------------------------------------------------------------------
/types/lexer/struct_c_lexer_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct c_lexer_state{
22 | struct struct_c_lexer_token_ptr_list tokens;
23 | struct common_lexer_state c;
24 | };
25 |
--------------------------------------------------------------------------------
/types/lexer/struct_l2_lexer_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l2_lexer_state{
22 | struct struct_l2_lexer_token_ptr_list tokens;
23 | struct common_lexer_state c;
24 | };
25 |
--------------------------------------------------------------------------------
/types/parser/enum_l2_parser_operation_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum l2_parser_operation_type{
20 | L2_INCREMENT_NEWLINE_COUNT,
21 | L2_ADVANCE_TOKEN_POSITION,
22 | L2_ADVANCE_PARSER_POSITION
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/parser/struct_parser_operation.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parser_operation{
22 | void * data;
23 | enum parser_operation_type type;
24 | unsigned int pad;
25 | };
26 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_preprocessor_file_context.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct preprocessor_file_context{
20 | unsigned char * filename;
21 | unsigned int current_line;
22 | unsigned int pad;
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/type_engine/struct_function_part_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct function_part_details{
22 | enum type_engine_function_part_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_pointer_part_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct pointer_part_details{
22 | enum type_engine_pointer_part_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/test/c89/main_with_parameters.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int main(int argc, char * argv[]){
20 | if(argc > 0){
21 | printf("%s", argv[0]);
22 | }else{
23 | printf("No args.");
24 | }
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/types/parser/struct_l2_parser_operation.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l2_parser_operation{
22 | void * data;
23 | enum l2_parser_operation_type type;
24 | unsigned int pad;
25 | };
26 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_bitfield_or_declarator_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_bitfield_or_declarator_kind{
20 | TYPE_ENGINE_HAS_BITFIELD,
21 | TYPE_ENGINE_DOES_NOT_HAVE_BITFIELD
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_parameter_list_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_parameter_list_kind {
20 | TYPE_ENGINE_PARAMETER_LIST_VARIADIC,
21 | TYPE_ENGINE_PARAMETER_LIST_NON_VARIADIC
22 | };
23 |
--------------------------------------------------------------------------------
/types/type_engine/struct_declarator_part_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct declarator_part_details{
22 | enum type_engine_declarator_part_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_enum_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct enum_specifier_details{
22 | enum type_engine_enum_specifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_identifier_from_declarator.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct identifier_from_declarator{
22 | struct identifier_id id;
23 | unsigned int initialized;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_parameter_list_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parameter_list_details{
22 | enum type_engine_parameter_list_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_union_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct union_specifier_details{
22 | enum type_engine_union_specifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/builtin/print_string.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_PRINT_STRING_
2 | #define BUILTIN_PRINT_STRING_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../generated/struct_printing_state.h"
20 |
21 | void print_string(struct printing_state *, const char *);
22 | #endif
23 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/strcmp_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | return strcmp((char*)a->key, (char*)b->key);
20 | }
21 |
--------------------------------------------------------------------------------
/types/type_engine/struct_struct_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct struct_specifier_details{
22 | enum type_engine_struct_specifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/regex_engine/struct_regex_match.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct regex_match;
20 | struct regex_match{
21 | struct regex_computation_node * match_node;
22 | unsigned int length;
23 | unsigned int first_match;
24 | };
25 |
26 |
27 |
--------------------------------------------------------------------------------
/builtin/print_buff_add.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_PRINT_BUFF_DEFINED_
2 | #define BUILTIN_PRINT_BUFF_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../generated/struct_printing_state.h"
20 |
21 | void print_buff_add(struct printing_state *, char);
22 | #endif
23 |
--------------------------------------------------------------------------------
/kernel/printf_busy.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_PRINTF_BUSY_
2 | #define BUILTIN_PRINTF_BUSY_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../libc/stdio.h"
20 |
21 | int printf_busy(const char * fmt, ...);
22 | int vprintf_busy(const char * fmt, va_list va);
23 | #endif
24 |
--------------------------------------------------------------------------------
/types/code_generator/struct_switch_frame.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct switch_frame{
22 | unsigned int condition_index;
23 | unsigned int has_default;
24 | struct unsigned_int_list values;
25 | };
26 |
--------------------------------------------------------------------------------
/types/type_engine/struct_aggregate_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct aggregate_specifier_details{
22 | enum type_engine_aggregate_specifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/test/c89/ignore-local.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int output(int);
20 |
21 | int output(int i){
22 | int j;
23 | (void)j;
24 | putchar(i);
25 | return 0;
26 | }
27 |
28 | int main(void){
29 | output('a');
30 | return 0;
31 | }
32 |
--------------------------------------------------------------------------------
/types/parser/enum_normalized_specifier_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum normalized_specifier_type{
20 | NORMALIZED_TYPE_SPECIFIER,
21 | NORMALIZED_TYPE_QUALIFIER,
22 | NORMALIZED_STORAGE_CLASS_SPECIFIER
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/types/lexer/struct_c_lexer_token.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct c_lexer_token{
22 | unsigned char * first_byte;
23 | unsigned char * last_byte;
24 | enum c_token_type type;
25 | unsigned int pad;
26 | };
27 |
--------------------------------------------------------------------------------
/types/lexer/struct_l2_lexer_token.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l2_lexer_token{
22 | unsigned char * first_byte;
23 | unsigned char * last_byte;
24 | enum l2_token_type type;
25 | unsigned int pad;
26 | };
27 |
--------------------------------------------------------------------------------
/types/type_engine/enum_scope_level_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum scope_level_type{
20 | SCOPE_LEVEL_TYPE_FUNCTION_SCOPE,
21 | SCOPE_LEVEL_TYPE_FUNCTION_PROTOTYPE_SCOPE,
22 | SCOPE_LEVEL_TYPE_FILE_SCOPE,
23 | SCOPE_LEVEL_TYPE_BLOCK_SCOPE
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_array_part_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_array_part_kind{
20 | TYPE_ENGINE_CONSTANT_EXPRESSION_ARRAY,
21 | TYPE_ENGINE_FLEXIBLE_ARRAY
22 | /* Others in the future... */
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_bitfield_or_declarator_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct bitfield_or_declarator_details{
22 | enum type_engine_bitfield_or_declarator_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_function_definition_collection.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct function_definition_collection{
22 | struct unsigned_int_to_void_ptr_map general_type_ids_to_function_definitions;
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/struct_specifier_or_qualifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct specifier_or_qualifier_details{
22 | enum type_engine_specifier_or_qualifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_unscoped_tag_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct unscoped_tag_specifier_details{
22 | enum type_engine_unscoped_tag_specifier_kind type;
23 | unsigned int id;
24 | };
25 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/simple_compare.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef STRING_H_DEFINED_
20 | #include
21 | #endif
22 | /*GETS_REPLACED_WITH_INCLUDES*/
23 |
24 | int T0_IDENTIFIER_compare(T0_LITERAL *, T0_LITERAL *);
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_enum_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct enum_definition {
22 | struct identifier_declaration_namespace * identifier_declaration_namespace;
23 | unsigned int is_completed;
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_aggregate_specifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_aggregate_specifier_kind {
20 | TYPE_ENGINE_SIMPLE_SPECIFIER,
21 | TYPE_ENGINE_TAG_SPECIFIER,
22 | TYPE_ENGINE_TYPENAME_SPECIFIER
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_general_type_list_item_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_general_type_list_item_kind {
20 | TYPE_ENGINE_GENERAL_TYPE_LIST_ITEM_GENERAL_TYPE,
21 | TYPE_ENGINE_GENERAL_TYPE_LIST_ITEM_LIST_START
22 | };
23 |
--------------------------------------------------------------------------------
/builtin/print_hexadecimal.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_PRINT_HEXADECIMAL_
2 | #define BUILTIN_PRINT_HEXADECIMAL_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../generated/struct_printing_state.h"
20 |
21 | void print_hexadecimal(struct printing_state *, unsigned int, unsigned int);
22 | #endif
23 |
--------------------------------------------------------------------------------
/types/type_engine/struct_scoped_tag_specifier_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct scoped_tag_specifier_details{
22 | struct scope_level_id scope_id;
23 | struct unscoped_tag_specifier_id unscoped_tag_specifier_id;
24 | };
25 |
--------------------------------------------------------------------------------
/libc/stdlib.h:
--------------------------------------------------------------------------------
1 | #ifndef STDLIB_H_DEFINED_
2 | #define STDLIB_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #ifndef SIZE_T_H_DEFINED_
19 | #include "size_t.h"
20 | #endif
21 | void * malloc(size_t);
22 | void * realloc(void *, size_t);
23 | void * calloc(size_t, size_t);
24 | void free(void*);
25 | #endif
26 |
--------------------------------------------------------------------------------
/test/c89/constants.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | static const char * a = "a";
20 |
21 | int main(void){
22 | putchar('a');
23 | printf("%s", "boo");
24 | printf("%i", 0xFFFFFFFFu);
25 | printf("%i", 0xFFFFFFFFU);
26 | printf("%s", a);
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_declarator_part_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_declarator_part_kind {
20 | TYPE_ENGINE_FUNCTION_DECLARATOR_PART,
21 | TYPE_ENGINE_POINTER_DECLARATOR_PART,
22 | TYPE_ENGINE_ARRAY_DECLARATOR_PART
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_declarator_part_list_item_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_declarator_part_list_item_kind {
20 | TYPE_ENGINE_DECLARATOR_PART_LIST_ITEM_DECLARATOR_PART,
21 | TYPE_ENGINE_DECLARATOR_PART_LIST_ITEM_LIST_START
22 | };
23 |
--------------------------------------------------------------------------------
/recc-implementation/templates/generic_header_merge_sort.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #ifndef STDLIB_H_DEFINED_
19 | #include
20 | #endif
21 | /*GETS_REPLACED_WITH_INCLUDES*/
22 |
23 | void T0_IDENTIFIER_merge_sort(T0_LITERAL *, unsigned int, int (*)(T0_LITERAL *, T0_LITERAL *));
24 |
--------------------------------------------------------------------------------
/types/linker/struct_linker_region.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct linker_region {
20 | struct linker_file * source_file;
21 | unsigned int start; /* In bytes */
22 | unsigned int length; /* In bytes */
23 | unsigned int permissions;
24 | unsigned int pad;
25 | };
26 |
27 |
28 |
--------------------------------------------------------------------------------
/builtin/print_buff_add.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include "print_buff_add.h"
18 |
19 | void print_buff_add(struct printing_state * ps, char c){
20 | if(ps->chars_required < ps->buffer_size){
21 | ps->buffer[ps->chars_required] = c;
22 | }
23 | ps->chars_required = ps->chars_required + 1;
24 | }
25 |
--------------------------------------------------------------------------------
/test/c89/while-loop.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int output(void);
20 |
21 | int output(void){
22 | int i = 0;
23 | while(i < 10){
24 | putchar('0' + i);
25 | i++;
26 | }
27 | return 0;
28 | }
29 |
30 |
31 | int main(void){
32 | output();
33 | return 0;
34 | }
35 |
--------------------------------------------------------------------------------
/types/parser/struct_parser_error.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parser_error{
22 | unsigned char * filename;
23 | enum parser_error_type type;
24 | unsigned int line_number;
25 | unsigned int tokens_position;
26 | unsigned int pad;
27 | };
28 |
--------------------------------------------------------------------------------
/recc-implementation/templates/generic_type_key_value_pair.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | struct T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair;
19 |
20 | /*GETS_REPLACED_WITH_INCLUDES*/
21 |
22 | struct T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair{
23 | T0_LITERAL key;
24 | T1_LITERAL value;
25 | };
26 |
--------------------------------------------------------------------------------
/types/linker/struct_start_end.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct start_end {
22 | struct linker_object * source;
23 | struct linker_symbol * symbol;
24 | unsigned int is_start; /* 1 = start offset, = 0 end offset */
25 | unsigned int pad;
26 | };
27 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_preprocessor_macro_level.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct preprocessor_macro_level{
22 | struct struct_c_lexer_token_ptr_list tokens;
23 | struct macro_definition * parent_macro;
24 | unsigned char * identifier;
25 | };
26 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_specifier_or_qualifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_specifier_or_qualifier_kind {
20 | TYPE_ENGINE_SIMPLE_STORAGE_CLASS_SPECIFIER,
21 | TYPE_ENGINE_SIMPLE_QUALIFIER,
22 | TYPE_ENGINE_AGGREGATE_TYPE_SPECIFIER
23 | };
24 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_unscoped_tag_specifier_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_unscoped_tag_specifier_kind{
20 | TYPE_ENGINE_UNSCOPED_ENUM_SPECIFIER,
21 | TYPE_ENGINE_UNSCOPED_STRUCT_SPECIFIER,
22 | TYPE_ENGINE_UNSCOPED_UNION_SPECIFIER
23 | };
24 |
--------------------------------------------------------------------------------
/kernel/level_1_page_table_entries.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | #include "kernel_state.h"
17 | /* Must be in a separate file to make sure it gets page aligned */
18 | unsigned int level_2_page_table_mappings[MAX_LEVEL_2_PAGE_TABLE_MAPPINGS];
19 | unsigned int level_1_page_table_mappings[MAX_LEVEL_1_PAGE_TABLE_MAPPINGS];
20 |
--------------------------------------------------------------------------------
/types/recc-implementation/struct_generic_list_item.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct generic_list_item {
20 | /* Used as an alternative to linked lists for tracking lists of unique items. */
21 | unsigned int data; /* currently contains a layout of bits for item type etc. */
22 | };
23 |
24 |
25 |
--------------------------------------------------------------------------------
/builtin/print_decimal.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_PRINT_DECIMAL_
2 | #define BUILTIN_PRINT_DECIMAL_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../generated/struct_printing_state.h"
20 |
21 | void print_decimal(struct printing_state *, int);
22 | void print_unsigned_decimal(struct printing_state *, unsigned int);
23 | #endif
24 |
--------------------------------------------------------------------------------
/recc-implementation/compiler_interface_phase_2.h:
--------------------------------------------------------------------------------
1 | #ifndef COMPILER_INTERFACE_PHASE_2_H_
2 | #define COMPILER_INTERFACE_PHASE_2_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../recc-implementation/compiler_interface_common.h"
20 | #include "../recc-implementation/compiler_interface_header_targets.h"
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/types/l0_generator/struct_l0_generator_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l0_generator_state {
22 | struct l2_lexer_state l2_lexer_state;
23 | struct l2_parser_state l2_parser_state;
24 | struct memory_pool_collection * memory_pool_collection;
25 | };
26 |
--------------------------------------------------------------------------------
/types/type_engine/struct_general_type_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct general_type_details{
22 | struct specifier_or_qualifier_list_item_id specifier_or_qualifier_list_item_id;
23 | struct bitfield_or_declarator_id bitfield_or_declarator_id;
24 | };
25 |
--------------------------------------------------------------------------------
/builtin/l2/memory_mapped_registers.l2:
--------------------------------------------------------------------------------
1 | ; The purpose of this file is to declare a non-relocable
2 | ; memory object that covers the memory-mapped registers at
3 | ; offset 0x300000. This will also prevent generated code
4 | ; from accidentally covering these registers after linking.
5 | OFFSET 0x300000
6 | VARIABLE memory_mapped_registers_start memory_mapped_registers_end
7 | IMPLEMENTS INTERNAL memory_mapped_registers_start
8 | IMPLEMENTS INTERNAL memory_mapped_registers_end
9 | memory_mapped_registers_start:
10 | SW 0x10; 0x300000 UART1_OUT
11 | SW 0x10; 0x300010 UART1_IN
12 | SW 0x10; 0x300020 IRQ_HANDLER
13 | SW 0x10; 0x300030 TIMER1_PERIOD
14 | SW 0x1; 0x300040 PAGE_POINTER
15 | SW 0x1; 0x300044 PFE_PAGE_POINTER
16 | SW 0x1; 0x300048 PFE_PC_VALUE
17 | SW 0x1; 0x30004C PFE_ACCESS
18 | SW 0x1; 0x300050 PFE_VIRTUAL
19 | memory_mapped_registers_end:
20 |
--------------------------------------------------------------------------------
/types/parser/struct_current_function_change.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct current_function_change {
20 | struct scope_level * target; /* The scope namespace for which we're going to change the current function */
21 | struct namespace_object * old_obj;
22 | struct namespace_object * new_obj;
23 | };
24 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/simple_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key < b->key){
20 | return -1;
21 | }else if(a->key > b->key){
22 | return 1;
23 | }else{
24 | return 0;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/types/type_engine/enum_type_engine_specifier_or_qualifier_list_item_kind.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum type_engine_specifier_or_qualifier_list_item_kind {
20 | TYPE_ENGINE_SPECIFIER_OR_QUALIFIER_LIST_ITEM_SPECIFIER_OR_QUALIFIER,
21 | TYPE_ENGINE_SPECIFIER_OR_QUALIFIER_LIST_ITEM_LIST_START
22 | };
23 |
--------------------------------------------------------------------------------
/types/regex_engine/struct_character_class_range.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct character_class_range;
20 | struct character_class_range{
21 | struct character_class_range * next;
22 | unsigned int is_dot;
23 | unsigned char low;
24 | unsigned char high;
25 | unsigned char pad1;
26 | unsigned char pad2;
27 | };
28 |
--------------------------------------------------------------------------------
/libc/stdarg.h:
--------------------------------------------------------------------------------
1 | #ifndef STDARG_H_DEFINED_
2 | #define STDARG_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #define va_list unsigned int *
19 | #define va_start(a,b) a = (unsigned int*)&b
20 | #define va_arg(a,b) *((b*)(a=(unsigned int *)((unsigned int)a - sizeof(unsigned int))))
21 | #define va_end(a)
22 | #define va_copy(a,b) a = b
23 | #endif
24 |
--------------------------------------------------------------------------------
/types/linker/struct_linker_object.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct linker_object{ /* Represents a function, variable or constant at global scope */
22 | unsigned char * start_label;
23 | unsigned char * end_label;
24 | enum l2_token_type type;
25 | unsigned int pad;
26 | };
27 |
--------------------------------------------------------------------------------
/types/parser/enum_normalized_declarator_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum normalized_declarator_type{
20 | NORMALIZED_DECLARATOR,
21 | NORMALIZED_ABSTRACT_DECLARATOR,
22 | NORMALIZED_STRUCT_DECLARATOR,
23 | NORMALIZED_INIT_DECLARATOR,
24 | NORMALIZED_ENUMERATOR
25 | };
26 |
27 |
28 |
--------------------------------------------------------------------------------
/types/parser/struct_namespace_object_change.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct namespace_object_change {
20 | struct namespace_object * target; /* The namespace object for which we're going to change one of its pointers */
21 | struct namespace_object * old_obj;
22 | struct namespace_object * new_obj;
23 | };
24 |
25 |
26 |
--------------------------------------------------------------------------------
/recc-implementation/compiler_interface_header_targets.h:
--------------------------------------------------------------------------------
1 | #ifndef COMPILER_INTERFACE_HEADER_TARGETS_H_
2 | #define COMPILER_INTERFACE_HEADER_TARGETS_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #include "../recc-implementation/compiler_interface_common.h"
20 |
21 | unsigned int make_header_target(struct build_state *, struct entity*);
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/types/code_generator/struct_compile_time_constant.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 |
20 | /*GETS_REPLACED_WITH_INCLUDES*/
21 |
22 | struct compile_time_constant{
23 | struct constant_description * constant_description; /* For everything else */
24 | struct normalized_declaration_element * element; /* For enum types */
25 | };
26 |
--------------------------------------------------------------------------------
/types/parser/struct_parser_node.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct parser_node;
22 |
23 | struct parser_node{
24 | struct parser_node * next;
25 | struct parser_node * first_child;
26 | struct c_lexer_token * c_lexer_token;
27 | enum node_type type;
28 | unsigned int pad;
29 | };
30 |
--------------------------------------------------------------------------------
/emulators/python/Makefile:
--------------------------------------------------------------------------------
1 | emulators/python/op_cpu_package/python_l0_module.py: emulators/python/build_python_example
2 | @./emulators/python/build_python_example
3 |
4 | run-python-emulator: emulators/python/op_cpu_package/python_l0_module.py
5 | @python emulators/python/linux-emulator-example.py
6 |
7 | emulators/python/build_python_example: emulators/python/build_python_example.o $(COMPILER_OBJECTS)
8 | @$(HOSTCC) -o emulators/python/build_python_example emulators/python/build_python_example.o $(COMPILER_OBJECTS) $(CUSTOM_C89_FLAGS)
9 |
10 | emulators/python/build_python_example.o: emulators/python/build_python_example.c recc-implementation/compiler_interface_phase_3.h
11 | @$(HOSTCC) -c emulators/python/build_python_example.c -o emulators/python/build_python_example.o $(CUSTOM_C89_FLAGS)
12 |
13 | clean-python-emulator:
14 | @rm -f emulators/python/build_python_example emulators/python/build_python_example.o emulators/python/op_cpu_package/*.pyc emulators/python/op_cpu_package/python_l0_module.py
15 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/type_engine_id_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key.id > b->key.id){
20 | return 1;
21 | }else if(a->key.id < b->key.id){
22 | return -1;
23 | }else{
24 | return 0;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/test/scripts/throw-error-on-problems-in-valgrind-log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 | trap "echo \"Exiting from ${0} due to error signal.\"; exit 1;" ERR
5 |
6 | echo "Begin checking for problems in valgrind log."
7 | if [ $(cat logs/valgrind.log | wc -l) -eq 0 ]; then echo "Valgrind log is empty. Should at least contain summary"; false; fi
8 | if [ $(cat logs/valgrind.log | grep "All heap blocks were freed -- no leaks are possible" | wc -l) -ne 1 ]; then cat logs/valgrind.log; false; fi
9 | if [ $(cat logs/valgrind.log | grep "depends on uninitialised value" | wc -l) -ne 0 ]; then cat logs/valgrind.log; false; fi
10 | if [ $(cat logs/valgrind.log | grep "Invalid write" | wc -l) -ne 0 ]; then cat logs/valgrind.log; false; fi
11 | if [ $(cat logs/valgrind.log | grep "Invalid read" | wc -l) -ne 0 ]; then cat logs/valgrind.log; false; fi
12 | if [ $(cat logs/valgrind.log | grep "Bad permissions" | wc -l) -ne 0 ]; then cat logs/valgrind.log; false; fi
13 | echo "No valgrind log errors observed."
14 | exit 0;
15 |
--------------------------------------------------------------------------------
/kernel/l2/getchar_nobusy.l2:
--------------------------------------------------------------------------------
1 | OFFSET RELOCATABLE
2 | FUNCTION getchar_nobusy getchar_nobusy_end
3 | IMPLEMENTS EXTERNAL getchar_nobusy
4 | IMPLEMENTS EXTERNAL getchar_nobusy_end
5 | getchar_nobusy:
6 | ; The bit mask for UART1_IN ready
7 | ll r3 0x400;
8 | ; The address of UART1_IN
9 | ll r5 0x3000;
10 | shl r5 WR; 0x30000
11 | shl r5 WR; 0x300000
12 | ll r2 0x10;
13 | add r5 r2 r5; 0x300010
14 | ; Get the byte
15 | loa r2 r5;
16 | ; Create a mask to unset the UART1_IN ready bit
17 | not r7 r3;
18 | ; Apply the mask to unset the UART1_IN ready bit
19 | and FR FR r7;
20 | ; Load the previous frame pointer
21 | loa FP SP;
22 | ; Jump over the frame pointer to get to the return address
23 | add SP SP WR;
24 | ; Load the return address
25 | loa r1 SP;
26 | ; Jump over the return address, which points us at the return address space (an int)
27 | add SP SP WR;
28 | ; Store our return value
29 | sto SP r2;
30 | ; Jump back to the place where the function was called
31 | add PC ZR r1;
32 | getchar_nobusy_end:
33 |
--------------------------------------------------------------------------------
/types/code_generator/struct_constant_initializer_level.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct constant_initializer_level{
22 | struct compile_time_constant * constant; /* Will be set only if this is not an initializer list */
23 | struct struct_constant_initializer_level_ptr_list children;
24 | };
25 |
--------------------------------------------------------------------------------
/types/parser/struct_l2_parser_node.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l2_parser_node;
22 |
23 | struct l2_parser_node{
24 | struct l2_parser_node * next;
25 | struct l2_parser_node * first_child;
26 | struct l2_lexer_token * l2_lexer_token;
27 | enum l2_node_type type;
28 | unsigned int pad;
29 | };
30 |
--------------------------------------------------------------------------------
/libc/string.h:
--------------------------------------------------------------------------------
1 | #ifndef STRING_H_DEFINED_
2 | #define STRING_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #ifndef SIZE_T_H_DEFINED_
19 | #include "size_t.h"
20 | #endif
21 | #ifndef ASSERT_H_DEFINED_
22 | #include
23 | #endif
24 | size_t strlen(const char *);
25 | int strcmp(const char *, const char *);
26 | void *memcpy(void *, const void *, size_t);
27 | #endif
28 |
--------------------------------------------------------------------------------
/types/parser/struct_first_and_last_namespace_object.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct first_and_last_namespace_object{
22 | struct namespace_object * first; /* The first namespace occupying namespace object resulting from a set of declarations */
23 | struct namespace_object * last; /* The last ... */
24 | };
25 |
--------------------------------------------------------------------------------
/types/type_engine/struct_general_type_list_item_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct general_type_list_item_details{
22 | enum type_engine_general_type_list_item_kind type;
23 | struct general_type_id item_id; /* Point to current item in this list */
24 | struct general_type_list_item_id prev_id;
25 | };
26 |
--------------------------------------------------------------------------------
/builtin/print_bits.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | void print_bits(unsigned int);
20 |
21 | void print_bits(unsigned int a){
22 | unsigned int i;
23 | for(i = 32; i > 0; i--){
24 | if(a & (0x1 << (i - 1))){
25 | putchar('1');
26 | }else{
27 | putchar('0');
28 | }
29 | if(i % 4 == 1){
30 | putchar(' ');
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/types/parser/struct_normalized_declarator.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct normalized_declarator{
22 | /*
23 | Used for abstracting away struct_declarator_list, init_declarator_list etc.
24 | */
25 | struct parser_node * declarator;
26 | enum normalized_declarator_type type;
27 | unsigned int pad;
28 | };
29 |
--------------------------------------------------------------------------------
/types/preprocessor/struct_macro_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct macro_definition{
22 | struct struct_c_lexer_token_ptr_list definition_tokens;
23 | struct unsigned_char_ptr_to_struct_macro_parameter_ptr_map function_macro_parameters;
24 | enum macro_definition_type type;
25 | unsigned int pad;
26 | };
27 |
--------------------------------------------------------------------------------
/types/regex_engine/struct_regex_compiler_error.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct regex_compiler_error;
22 | struct regex_compiler_error{
23 | struct regex_compiler_error * next;
24 | enum regex_compiler_error_type type;
25 | unsigned int error_raised;
26 | unsigned int character_index_of_error;
27 | unsigned int pad;
28 | };
29 |
--------------------------------------------------------------------------------
/types/type_engine/struct_declarator_part_list_item_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct declarator_part_list_item_details{
22 | enum type_engine_declarator_part_list_item_kind type;
23 | struct declarator_part_id item_id; /* Point to current item in this list */
24 | struct declarator_part_list_item_id prev_id;
25 | };
26 |
--------------------------------------------------------------------------------
/types/type_engine/struct_struct_or_union_definition.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct struct_or_union_definition {
22 | enum type_engine_unscoped_tag_specifier_kind type; /* Should only be struct or union. */
23 | struct identifier_declaration_namespace * identifier_declaration_namespace;
24 | unsigned int is_completed;
25 | };
26 |
--------------------------------------------------------------------------------
/kernel/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | #include "public_kernel_interface.h"
17 | #include "kernel_state.h"
18 |
19 | int putchar(int);
20 |
21 | int main(void){
22 | /* Need to set the kernel stack pointer before we can make any kernel calls */
23 | g_kernel_sp = &kernel_stack[STACK_SIZE -1];
24 | kernel_init(); /* This method will block until the kernel exits */
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/recc-implementation/struct_entity_relationship.h:
--------------------------------------------------------------------------------
1 | #ifndef TYPES_struct_entity_relationship_H_
2 | #define TYPES_struct_entity_relationship_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #ifndef enum_entity_relation_type_H_
19 | #include "enum_entity_relation_type.h"
20 | #endif
21 |
22 | struct entity_relationship{
23 | struct entity * entity;
24 | enum entity_relation_type type;
25 | };
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/test/c99/snprintf_test.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int main(void){
20 | char c[40];
21 | printf("Num bytes needed is %d\n", snprintf(&c[0], 40, "%d", 99));
22 | printf("Num bytes needed is %d\n", snprintf(&c[0], 2, "%d %d", 99, 54353));
23 | printf("Num bytes needed is %d\n", snprintf(&c[0], 40, "%d", 333934));
24 | printf("%s\n", &c[0]);
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/recc-implementation/compiler_interface_phase_1.h:
--------------------------------------------------------------------------------
1 | #ifndef COMPILER_INTERFACE_PHASE_1_H_
2 | #define COMPILER_INTERFACE_PHASE_1_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef STDIO_H_DEFINED_
20 | #include
21 | #endif
22 | #ifndef STDLIB_H_DEFINED_
23 | #include
24 | #endif
25 | #ifndef LIBBOOTSTRAP_H_DEFINED_
26 | #include "../recc-implementation/libbootstrap.h"
27 | #endif
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/types/parser/enum_normalized_declaration_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum normalized_declaration_type{
20 | NORMALIZED_DECLARATION,
21 | NORMALIZED_FUNCTION_DEFINITION,
22 | NORMALIZED_PARAMETER_DECLARATION,
23 | NORMALIZED_STRUCT_DECLARATION,
24 | NORMALIZED_K_AND_R_C_IDENTIFIER_DECLARATOR_PAIR,
25 | NORMALIZED_ENUMERATOR_LIST
26 | };
27 |
28 |
29 |
--------------------------------------------------------------------------------
/types/parser/struct_normalized_specifier.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 |
20 | /*GETS_REPLACED_WITH_INCLUDES*/
21 |
22 | struct normalized_specifier{
23 | /*
24 | Used for abstracting away declaration_specifiers, type_specifier_list,
25 | and qualifier_specifier_list
26 | */
27 | struct parser_node * specifier;
28 | enum normalized_specifier_type type;
29 | unsigned int pad;
30 | };
31 |
--------------------------------------------------------------------------------
/types/regex_engine/struct_regex_parser_node.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct regex_parser_node;
22 | struct regex_parser_node{
23 | struct regex_parser_node * next;
24 | struct regex_parser_node * first_child;
25 | enum regex_parser_node_type type;
26 | unsigned char c;
27 | unsigned char pad1;
28 | unsigned char pad2;
29 | unsigned char pad3;
30 | };
31 |
--------------------------------------------------------------------------------
/types/type_engine/struct_specifier_or_qualifier_list_item_details.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct specifier_or_qualifier_list_item_details{
22 | enum type_engine_specifier_or_qualifier_list_item_kind type;
23 | struct specifier_or_qualifier_id item_id; /* Point to current item in this list */
24 | struct specifier_or_qualifier_list_item_id prev_id;
25 | };
26 |
--------------------------------------------------------------------------------
/emulators/java/OpCPU/OpCPUDataInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | package OpCPU;
17 |
18 | /* If you want to create your own data packages, just subclass the interface, and you can pass it into the OpCPU Class */
19 |
20 | public interface OpCPUDataInterface{
21 | /* Returns an array of 2 longs. The first memeber identifies what type of instruction the second long is. */
22 | public long [] getData(Long index);
23 | }
24 |
--------------------------------------------------------------------------------
/kernel/l2/putchar_nobusy.l2:
--------------------------------------------------------------------------------
1 | OFFSET RELOCATABLE
2 | FUNCTION putchar_nobusy putchar_nobusy_end
3 | IMPLEMENTS EXTERNAL putchar_nobusy
4 | IMPLEMENTS EXTERNAL putchar_nobusy_end
5 | putchar_nobusy:
6 | loa r2 SP; Load whatever that argument was.
7 | ; The bit mask for UART1_OUT ready
8 | ll r3 0x200;
9 | ; The address of UART1_OUT
10 | ll r5 0x3000;
11 | shl r5 WR; 0x30000
12 | shl r5 WR; 0x300000
13 | ; Put the byte
14 | sto r5 r2;
15 | ; Create a mask to unset the UART1_OUT ready bit
16 | not r7 r3;
17 | ; Apply the mask to unset the UART1_OUT ready bit
18 | and FR FR r7;
19 | ; Increment the stack pointer to get over the one argument
20 | ; that is a 4 byte integer
21 | add SP SP WR;
22 | ; Load the previous frame pointer
23 | loa FP SP;
24 | ; Jump over the frame pointer to get to the return address
25 | add SP SP WR;
26 | ; Load the return address
27 | loa r1 SP;
28 | ; Jump over the return address, which points us at the return address space (an int)
29 | add SP SP WR;
30 | ; Jump back to the place where the function was called
31 | add PC ZR r1;
32 | putchar_nobusy_end:
33 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/generic_list_item_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key.data > b->key.data){
20 | return 1;
21 | }else if(a->key.data < b->key.data){
22 | return -1;
23 | }else{
24 | return 0;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/test/extras/main_argv_indirect.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | int main(int, char * []);
18 | int main_argv_indirect(void);
19 |
20 | int main_argv_indirect(void){
21 | /* Call the 'real' main method with arguments */
22 | int argc = 1;
23 | char * argv[2];
24 | argv[0] = (char *)"./test/c89/main_with_parameters.exec"; /* Currently used for a specific unit test. */
25 | argv[1] = (char *)0;
26 | return main(argc, argv);
27 | }
28 |
--------------------------------------------------------------------------------
/recc-implementation/enum_entity_relation_type.h:
--------------------------------------------------------------------------------
1 | #ifndef enum_entity_relation_type_H_
2 | #define enum_entity_relation_type_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum entity_relation_type{
20 | RELATION_TYPE_DEPENDS_ON_AT_BUILD_TIME,
21 | RELATION_TYPE_IS_DEPENDED_ON_AT_BUILD_TIME_BY,
22 | RELATION_TYPE_CONTAINS,
23 | RELATION_TYPE_IS_CONTAINED_BY,
24 | RELATION_TYPE_INCLUDES,
25 | RELATION_TYPE_IS_INCLUDED_BY
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/test/c89/nested-putchar-a.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int foo1(void);
20 | int foo2(void);
21 | int foo3(void);
22 |
23 | int foo1(void){
24 | putchar('a');
25 | return 0;
26 | }
27 |
28 | int foo2(void){
29 | foo1();
30 | putchar('a');
31 | return 0;
32 | }
33 |
34 | int foo3(void){
35 | foo2();
36 | putchar('a');
37 | return 0;
38 | }
39 |
40 | int main(void){
41 | foo3();
42 | return 0;
43 | }
44 |
--------------------------------------------------------------------------------
/test/extras/includetest1.h:
--------------------------------------------------------------------------------
1 | #include "includetest2.h"
2 | #include "includetest2.h"
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #include "includetest2.h"
19 | #include "includetest2.h"
20 | #include "includetest2.h"
21 | #include "includetest2.h"
22 |
23 | #define def1
24 | #define boo 345
25 | #ifndef boo
26 | putchar('a');
27 | #endif
28 | #ifndef foofds_
29 | putchar('o');
30 | #endif
31 |
32 |
33 | putchar('a');
34 | putchar('b');
35 | putchar('c');
36 |
--------------------------------------------------------------------------------
/test/extras/extern_test.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | extern unsigned int global_1;
18 | extern unsigned int global_2;
19 |
20 | extern unsigned int test_arr[3];
21 |
22 | unsigned int global_1;
23 | unsigned int global_2 = 3;
24 |
25 | unsigned int test_arr[3];
26 |
27 | struct bootest{
28 | unsigned int arr[4];
29 | unsigned int k;
30 | };
31 |
32 | extern struct bootest global_struct_test;
33 |
34 | struct bootest global_struct_test;
35 |
--------------------------------------------------------------------------------
/recc-implementation/bootstrap_phase_2.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include "compiler_interface_phase_2.h"
18 |
19 | void new_register_data_structures_objects(struct build_state *);
20 |
21 | int main(void){
22 | struct build_state * state;
23 | state = create_build_state();
24 |
25 | new_register_data_structures_objects(state);
26 | construct_generated_c_entities(state);
27 |
28 | destroy_build_state(state);
29 | return 0;
30 | }
31 |
--------------------------------------------------------------------------------
/builtin/c99libc_in_c89.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTIN_C99LIBC_IN_C89_
2 | #define BUILTIN_C99LIBC_IN_C89_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 | #include
19 | #include
20 | #include
21 | #include "print_buff_add.h"
22 | #include "print_string.h"
23 | #include "print_decimal.h"
24 | #include "print_hexadecimal.h"
25 | #include "../generated/struct_printing_state.h"
26 |
27 | unsigned int c89_vsnprintf(char *, size_t, const char *, va_list);
28 | #endif
29 |
--------------------------------------------------------------------------------
/types/parser/struct_constant_description.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct constant_description{
22 | struct type_description * type_description;
23 | unsigned char * str;
24 | unsigned int * native_data; /* Byte array of the data used in the program */
25 | unsigned int size_in_bytes;
26 | unsigned int num_references;
27 | enum c_token_type type;
28 | unsigned int pad;
29 | unsigned int id;
30 | };
31 |
--------------------------------------------------------------------------------
/test/c89/nested-putchar-a-param-ignored.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | int foo1(int);
20 | int foo2(int);
21 | int foo3(int);
22 |
23 | int foo1(int i){
24 | (void)i;
25 | putchar('a');
26 | return 0;
27 | }
28 |
29 | int foo2(int i){
30 | foo1(i);
31 | putchar('a');
32 | return 0;
33 | }
34 |
35 | int foo3(int i){
36 | foo2(i);
37 | putchar('a');
38 | return 0;
39 | }
40 |
41 | int main(void){
42 | foo3(97);
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/libc/assert.h:
--------------------------------------------------------------------------------
1 | #ifndef ASSERT_H_DEFINED_
2 | #define ASSERT_H_DEFINED_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 |
20 | #ifndef STDIO_H_DEFINED_
21 | #include
22 | #endif
23 |
24 | #define assert_stringify_indirect(a) #a
25 | #define assert_stringify(a) assert_stringify_indirect(a)
26 |
27 | #define assert(a) if(!(a)){printf("Assertion failure of expression '"assert_stringify_indirect(a)"' in file "assert_stringify(__FILE__)" on line "assert_stringify(__LINE__)".\n");}
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/types/recc-implementation/enum_entity_type.h:
--------------------------------------------------------------------------------
1 | #ifndef TYPES_enum_entity_type_H_
2 | #define TYPES_enum_entity_type_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum entity_type{
20 | ENTITY_TYPE_GENERATED_C_CODE,
21 | ENTITY_TYPE_SOURCE,
22 | ENTITY_TYPE_L2_FILE,
23 | ENTITY_TYPE_L1_FILE,
24 | ENTITY_TYPE_L0_FILE,
25 | ENTITY_TYPE_C_FILE,
26 | ENTITY_TYPE_OBJECT_FILE,
27 | ENTITY_TYPE_PREPROCESSED_FILE,
28 | ENTITY_TYPE_FILESYSTEM_IMPLEMENTATION,
29 | ENTITY_TYPE_SYMBOL_FILE
30 | };
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/types/parser/struct_l2_parser_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct l2_parser_state{
22 | struct memory_pool_collection * memory_pool_collection;
23 | struct l2_lexer_state * l2_lexer_state;
24 | struct l2_parser_node * top_node;
25 | struct unsigned_char_list * buffered_output;
26 | struct struct_l2_parser_operation_list operation_stack;
27 | unsigned char * buff;
28 | unsigned int tokens_position;
29 | unsigned int line_number;
30 | };
31 |
--------------------------------------------------------------------------------
/types/parser/struct_namespace_modification.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | struct namespace_modification{
20 | struct normalized_declaration_element * new_element;
21 | struct namespace_object * object;
22 | struct scope_level * scope_level;
23 | struct unsigned_char_ptr_to_struct_namespace_object_ptr_map * scope_namespace;
24 | unsigned char * identifier_str;
25 | enum scope_type scope_type;
26 | enum object_location object_location;
27 | int offset;
28 | int pad;
29 | };
30 |
31 |
32 |
--------------------------------------------------------------------------------
/types/regex_engine/enum_regex_compiler_error_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum regex_compiler_error_type{
20 | REGEX_ERROR_INVALID_CHARACTER_SEQUENCE,
21 | REGEX_ERROR_INVALID_CHARACTER_CLASS,
22 | REGEX_ERROR_NOT_ESCAPABLE,
23 | REGEX_ERROR_EXPECTED_HEX_DIGIT,
24 | REGEX_ERROR_EXPECTED_INFIX_EXPRESSION_REST,
25 | REGEX_ERROR_INCOMPLETE_PARSING,
26 | REGEX_ERROR_PARSING_FAILED,
27 | REGEX_ERROR_INVALID_REGULAR_EXPRESSION,
28 | REGEX_ERROR_INVALID_CHARACTER_RANGE
29 | };
30 |
31 |
32 |
--------------------------------------------------------------------------------
/recc-implementation/templates/generic_header_binary_search.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | enum T0_IDENTIFIER_binary_search_not_found_result_type{
22 | T0_IDENTIFIER_BINARY_SEARCH_RETURN_NEG_ONE,
23 | T0_IDENTIFIER_BINARY_SEARCH_RETURN_MIN,
24 | T0_IDENTIFIER_BINARY_SEARCH_RETURN_MAX
25 | };
26 |
27 | int T0_IDENTIFIER_binary_search(T0_LITERAL * a, T0_LITERAL *, int, int (*)(T0_LITERAL *, T0_LITERAL *), enum T0_IDENTIFIER_binary_search_not_found_result_type);
28 |
--------------------------------------------------------------------------------
/types/parser/enum_type_class.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | enum type_class{
22 | TYPE_CLASS_CHAR,
23 | TYPE_CLASS_SHORT,
24 | TYPE_CLASS_INT,
25 | TYPE_CLASS_LONG,
26 | TYPE_CLASS_LONG_LONG,
27 | TYPE_CLASS_FLOAT,
28 | TYPE_CLASS_DOUBLE,
29 | TYPE_CLASS_LONG_DOUBLE,
30 | TYPE_CLASS_VOID,
31 | TYPE_CLASS_POINTER,
32 | TYPE_CLASS_ARRAY,
33 | TYPE_CLASS_FUNCTION,
34 | TYPE_CLASS_ENUM,
35 | TYPE_CLASS_STRUCT,
36 | TYPE_CLASS_UNION
37 | };
38 |
39 |
40 |
--------------------------------------------------------------------------------
/test/c89/va_list_call.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | void print(unsigned int arg1, ...);
21 |
22 | void print(unsigned int arg1, ...){
23 | va_list v;
24 |
25 | va_start(v, arg1);
26 | putchar((int)va_arg(v, unsigned int));
27 | putchar((int)va_arg(v, unsigned int));
28 | putchar((int)va_arg(v, unsigned int));
29 | putchar((int)va_arg(v, unsigned int));
30 | va_end(v);
31 | }
32 |
33 | int main(void){
34 | print(97, 98, 99, 100, 101);
35 | return 0;
36 | }
37 |
--------------------------------------------------------------------------------
/types/regex_engine/enum_regex_computation_node_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum regex_computation_node_type {
20 | REGEX_COMP_UNUSED, /* To trick clang to not warn of unreachable code in default branch */
21 | REGEX_COMP_CHAR,
22 | REGEX_COMP_CHAR_STAR,
23 | REGEX_COMP_DOT,
24 | REGEX_COMP_DOT_STAR,
25 | REGEX_COMP_CLASS,
26 | REGEX_COMP_CLASS_STAR,
27 | REGEX_COMP_NEG_CLASS,
28 | REGEX_COMP_NEG_CLASS_STAR,
29 | REGEX_COMP_SPLIT,
30 | REGEX_COMP_JUMP,
31 | REGEX_COMP_MATCH
32 | };
33 |
34 |
35 |
--------------------------------------------------------------------------------
/builtin/print_string.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include "print_buff_add.h"
18 | #include "../generated/struct_printing_state.h"
19 | #include "print_string.h"
20 |
21 | void print_string(struct printing_state * ps, const char * c){
22 | if(c){
23 | while(*c){
24 | print_buff_add(ps, *c);
25 | c++;
26 | }
27 | }else{
28 | print_buff_add(ps, '(');
29 | print_buff_add(ps, 'n');
30 | print_buff_add(ps, 'u');
31 | print_buff_add(ps, 'l');
32 | print_buff_add(ps, 'l');
33 | print_buff_add(ps, ')');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/types/lexer/struct_common_lexer_state.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct common_lexer_state {
22 | struct regex_compiler_state ** compiler_states;
23 | struct regex_matcher_state matcher;
24 | unsigned char * buf;
25 | unsigned char * filename;
26 | struct memory_pool_collection * memory_pool_collection;
27 | struct unsigned_char_list * buffered_output;
28 | unsigned int position;
29 | unsigned int current_line;
30 | unsigned int buffer_size;
31 | unsigned int pad;
32 | };
33 |
--------------------------------------------------------------------------------
/types/code_generator/struct_type_traversal.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct type_traversal{
22 | struct type_description * type_description;
23 | struct struct_type_traversal_ptr_list children;
24 | unsigned int arity; /* For arrays */
25 | unsigned int arrays_as_pointers; /* For arrays */
26 | unsigned char * parent_tag_name; /* structs, enums, unions */
27 | unsigned char * member_name; /* for structs, enums */
28 | enum type_class type_class;
29 | unsigned int pad;
30 | };
31 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/type_engine_details_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key.type > b->key.type){
20 | return 1;
21 | }else if(a->key.type < b->key.type){
22 | return -1;
23 | }else{
24 | if(a->key.id > b->key.id){
25 | return 1;
26 | }else if(a->key.id < b->key.id){
27 | return -1;
28 | }else{
29 | return 0;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/types/parser/enum_parser_operation_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum parser_operation_type{
20 | INCREMENT_NEWLINE_COUNT,
21 | PROCESS_CONSTANT,
22 | ACCEPT_IDENTIFIER,
23 | ADVANCE_TOKEN_POSITION,
24 | ADVANCE_PARSER_POSITION,
25 | INCREMENT_SCOPE_DEPTH,
26 | DECREMENT_SCOPE_DEPTH,
27 | RECORD_EXTERN_DECLARATION,
28 | SAVE_DECLARATION_ELEMENTS,
29 | NAMESPACE_MODIFICATION,
30 | CREATE_PARSER_NODE_TREE,
31 | SET_NEXT_NAMESPACE_OBJECT,
32 | SET_PREVIOUS_NAMESPACE_OBJECT,
33 | SET_CURRENT_FUNCTION
34 | };
35 |
36 |
37 |
--------------------------------------------------------------------------------
/kernel/l2/putchar_busy.l2:
--------------------------------------------------------------------------------
1 | OFFSET RELOCATABLE
2 | FUNCTION putchar_busy _end_putchar_busy
3 | IMPLEMENTS EXTERNAL putchar_busy
4 | IMPLEMENTS EXTERNAL _end_putchar_busy
5 | putchar_busy:
6 | loa r2 SP; Load whatever that argument was.
7 | ; The bit mask for UART1_OUT ready
8 | ll r3 0x200;
9 | ; The address of UART1_OUT
10 | ll r5 0x3000;
11 | shl r5 WR; 0x30000;
12 | shl r5 WR; 0x300000;
13 | ; Mask out the UART1_OUT ready bit
14 | and r6 FR r3;
15 | ; Busy wait on the bit being set
16 | beq r6 ZR -2;
17 | ; Put the byte
18 | sto r5 r2;
19 | ; Create a mask to unset the UART1_OUT ready bit
20 | not r7 r3;
21 | ; Apply the mask to unset the UART1_OUT ready bit
22 | and FR FR r7;
23 | ; Increment the stack pointer to get over the one argument
24 | ; that is a 4 byte integer
25 | add SP SP WR;
26 | ; Load the previous frame pointer
27 | loa FP SP;
28 | ; Jump over the frame pointer to get to the return address
29 | add SP SP WR;
30 | ; Load the return address
31 | loa r1 SP;
32 | ; Jump over the return address, which points us at the return address space (an int)
33 | add SP SP WR;
34 | ; Return 0
35 | sto SP ZR;
36 | ; Jump back to the place where the function was called
37 | add PC ZR r1;
38 | _end_putchar_busy:
39 |
--------------------------------------------------------------------------------
/test/c89/basic-putchar-b.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | #include
18 |
19 | void fun(void);
20 |
21 | void fun(void){
22 | return;
23 | }
24 |
25 | static int arr[3][3] = {
26 | {98,99,100},
27 | {101,102,103},
28 | {104,105,106}
29 | };
30 |
31 | int main(void){
32 | putchar('b');
33 | putchar(arr[0][0]);
34 | putchar(arr[0][1]);
35 | putchar(arr[0][2]);
36 | putchar(arr[1][0]);
37 | putchar(arr[1][1]);
38 | putchar(arr[1][2]);
39 | putchar(arr[2][0]);
40 | putchar(arr[2][1]);
41 | putchar(arr[2][2]);
42 | fun();
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/emulators/c/enum_l0_instruction_type.h:
--------------------------------------------------------------------------------
1 | #ifndef OP_CPU_enum_l0_instruction_type_H_
2 | #define OP_CPU_enum_l0_instruction_type_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum l0_instruction_type {
20 | L0_ADD_INSTRUCTION,
21 | L0_SUB_INSTRUCTION,
22 | L0_MUL_INSTRUCTION,
23 | L0_DIV_INSTRUCTION,
24 | L0_BEQ_INSTRUCTION,
25 | L0_BLT_INSTRUCTION,
26 | L0_LOA_INSTRUCTION,
27 | L0_STO_INSTRUCTION,
28 | L0_LL_INSTRUCTION,
29 | L0_AND_INSTRUCTION,
30 | L0_OR_INSTRUCTION,
31 | L0_NOT_INSTRUCTION,
32 | L0_SHR_INSTRUCTION,
33 | L0_SHL_INSTRUCTION
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/emulators/c/struct_l0_item.h:
--------------------------------------------------------------------------------
1 | #ifndef OP_CPU_struct_l0_item_H_
2 | #define OP_CPU_struct_l0_item_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef OP_CPU_enum_l0_instruction_type_H_
20 | #include "enum_l0_instruction_type.h"
21 | #endif
22 | #ifndef OP_CPU_enum_l0_directive_type_H_
23 | #include "enum_l0_directive_type.h"
24 | #endif
25 |
26 | struct l0_item{
27 | unsigned int instruction_registers[3];
28 | enum l0_instruction_type type;
29 | enum l0_directive_type directive_type;
30 | unsigned int constant_is_negative;
31 | unsigned int constant;
32 | };
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/kernel/putchar.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | #include "public_kernel_interface.h"
17 | #include
18 |
19 | int putchar(int);
20 | int putchar_nobusy(int);
21 |
22 | int putchar(int c){
23 | struct kernel_message putchar_m;
24 | struct kernel_message putchar_reply;
25 | putchar_m.message_type = OUTPUT_CHARACTER;
26 | putchar_m.data = c;
27 | send_message(&putchar_m, 6, &putchar_reply);
28 | switch(putchar_reply.message_type){
29 | case MESSAGE_ACKNOWLEDGED:{
30 | break;
31 | }default:{
32 | assert(0 && "Unknown message type.\n");
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/emulators/javascript/chrome/chrome-plugin/background.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 |
18 | /* Account for API changes. */
19 | var theRuntime = (typeof chrome.runtime === 'undefined') ? chrome.extension : chrome.runtime;
20 |
21 | theRuntime.onMessage.addListener(
22 | function(request, sender, sendResponse) {
23 | if (request.greeting == "hello"){
24 | chrome.tabs.query({'active': true, 'windowId': chrome.windows.WINDOW_ID_CURRENT},
25 | function(tabs){
26 | chrome.tabs.remove(tabs[0].id, function() {});
27 | }
28 | );
29 | }
30 | }
31 | );
32 |
--------------------------------------------------------------------------------
/types/parser/struct_normalized_declaration_element.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct normalized_declaration_element{
22 | /* In the normalized_declaration_element, the normalized_declarator can
23 | ONLY HAVE ONE declarator in whatever declarator list it
24 | uses to describe the declaration.
25 | */
26 | struct normalized_declaration_set * normalized_declaration_set; /* the declaration set (declarator list) this element belongs to */
27 | struct normalized_declarator * normalized_declarator;
28 | struct struct_normalized_specifier_ptr_list * normalized_specifiers;
29 | };
30 |
--------------------------------------------------------------------------------
/emulators/javascript/get-available-tests/index.php:
--------------------------------------------------------------------------------
1 |
33 |
--------------------------------------------------------------------------------
/kernel/public_kernel_interface.h:
--------------------------------------------------------------------------------
1 | #ifndef PUBLIC_KERNEL_INTERFACE_H_
2 | #define PUBLIC_KERNEL_INTERFACE_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | #ifndef KERNEL_STATE_H_
20 | #include "kernel_state.h"
21 | #endif
22 | #ifndef QUEUE_H_DEFINED_
23 | #include "queue.h"
24 | #endif
25 |
26 | unsigned int release_processor(void);
27 | void task_exit(void);
28 | void kernel_init(void);
29 | void kernel_exit(void);
30 | void block_on_event(enum kernel_event);
31 | void send_message(struct kernel_message *, unsigned int, struct kernel_message *);
32 | void receive_message(struct kernel_message *);
33 | void reply_message(struct kernel_message *, unsigned int);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/types/type_engine/struct_identifier_declaration_namespace.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct identifier_declaration_namespace{
22 | /* An ordered list of type ids of things that are declared in this namespace */
23 | struct struct_general_type_id_list ordered_type_ids;
24 | /* Allows us to map an identifier to the type id it is associated with */
25 | struct struct_identifier_id_to_struct_general_type_id_map identifier_ids_to_type_ids;
26 | /* Allows us to map an identifier to the index it has in its scope */
27 | struct struct_identifier_id_to_unsigned_int_map identifier_id_to_ordered_index;
28 | };
29 |
--------------------------------------------------------------------------------
/types/regex_engine/enum_regex_parser_node_type.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum regex_parser_node_type{
20 | REGEX_HEX_DIGIT,
21 | REGEX_ESCAPABLE_CHARACTER,
22 | REGEX_ESCAPED_CHARACTER,
23 | REGEX_CHARACTER_RANGE,
24 | REGEX_CHARACTER_OR_RANGE,
25 | REGEX_CHARACTER_OR_CLASS,
26 | REGEX_CHARACTER_CLASS_REST,
27 | REGEX_CHARACTER_CLASS,
28 | REGEX_NON_CLASS_CHARACTER,
29 | REGEX_CHARACTER_SEQUENCE_REST,
30 | REGEX_CHARACTER_SEQUENCE,
31 | REGEX_POSTFIX_OPERATOR,
32 | REGEX_POSTFIX_EXPRESSION,
33 | REGEX_INFIX_EXPRESSION_REST,
34 | REGEX_INFIX_EXPRESSION,
35 | REGEX_REGULAR_EXPRESSION,
36 | REGEX_TERMINAL,
37 | REGEX_EPSILON
38 | };
39 |
40 |
41 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/entity_relationship_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key.entity > b->key.entity){
20 | return 1;
21 | }else if(a->key.entity < b->key.entity){
22 | return -1;
23 | }else{
24 | if(a->key.type > b->key.type){
25 | return 1;
26 | }else if(a->key.type < b->key.type){
27 | return -1;
28 | }else{
29 | return 0;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/recc-implementation/templates/comparison-functions/type_engine_scoped_type_compare.c:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 | /*GETS_REPLACED_WITH_INCLUDES*/
17 |
18 | int T0_IDENTIFIER_compare(T0_LITERAL * a, T0_LITERAL * b){
19 | if(a->key.scope_id.id > b->key.scope_id.id){
20 | return 1;
21 | }else if(a->key.scope_id.id < b->key.scope_id.id){
22 | return -1;
23 | }else{
24 | if(a->key.unscoped_tag_specifier_id.id > b->key.unscoped_tag_specifier_id.id){
25 | return 1;
26 | }else if(a->key.unscoped_tag_specifier_id.id < b->key.unscoped_tag_specifier_id.id){
27 | return -1;
28 | }else{
29 | return 0;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/recc-implementation/templates/generic_type_map.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | /*GETS_REPLACED_WITH_INCLUDES*/
20 |
21 | struct T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair; /* Requires pre-declaration for some recursive data structures. */
22 |
23 | struct T0_IDENTIFIER_to_T1_IDENTIFIER_map{
24 | struct binary_exponential_buffer key_value_pairs;
25 | int (*compare)(struct T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair *, struct T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair *);
26 | };
27 |
28 | #ifndef TYPES_DATA_STRUCTURES_struct_T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair_H_
29 | #include "../generated/struct_T0_IDENTIFIER_to_T1_IDENTIFIER_key_value_pair.h"
30 | #endif
31 |
--------------------------------------------------------------------------------
/emulators/c/enum_l0_directive_type.h:
--------------------------------------------------------------------------------
1 | #ifndef OP_CPU_enum_l0_directive_type_H_
2 | #define OP_CPU_enum_l0_directive_type_H_
3 | /*
4 | Copyright 2016 Robert Elder Software Inc.
5 |
6 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | use this file except in compliance with the License. You may obtain a copy
8 | of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing, software
13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | License for the specific language governing permissions and limitations
16 | under the License.
17 | */
18 |
19 | enum l0_directive_type {
20 | L0_MACHINE_INSTRUCTION,
21 | L0_DW_DIRECTIVE,
22 | L0_SW_DIRECTIVE,
23 | L0_OFFSET_ADDRESS_DIRECTIVE,
24 | L0_STRING_DIRECTIVE,
25 | L0_LINKAGE_DIRECTIVE,
26 | L0_UNRESOLVED_DIRECTIVE,
27 | L0_FUNCTION_DIRECTIVE,
28 | L0_VARIABLE_DIRECTIVE,
29 | L0_CONSTANT_DIRECTIVE,
30 | L0_START_DIRECTIVE,
31 | L0_END_DIRECTIVE,
32 | L0_IMPLEMENTED_DIRECTIVE,
33 | L0_REQUIRED_DIRECTIVE,
34 | L0_REGION_DIRECTIVE,
35 | L0_PERMISSION_DIRECTIVE,
36 | L0_IMAGE_SIZE,
37 | L0_NUM_L0_ITEMS
38 | };
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/emulators/javascript/chrome/chrome-plugin/close-chrome-tab.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Robert Elder Software Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | use this file except in compliance with the License. You may obtain a copy
6 | of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | License for the specific language governing permissions and limitations
14 | under the License.
15 | */
16 |
17 | /* Account for API changes. */
18 | var theRuntime = (typeof chrome.runtime === 'undefined') ? chrome.extension : chrome.runtime;
19 |
20 | function chromePluginCloseCurrentChromeTab(){
21 | if(!(document.getElementById('close-chrome-1234') == null)){
22 | /* The constant below is found by loading this unpacked extension, then copying the "ID" field found in the browser extensions list */
23 | theRuntime.sendMessage(theRuntime.id, {greeting: "hello"}, function(response) {
24 | });
25 | }
26 | setTimeout(chromePluginCloseCurrentChromeTab, 100);
27 | }
28 | chromePluginCloseCurrentChromeTab();
29 |
--------------------------------------------------------------------------------