Skip to content

Commit

Permalink
refactoring, bugfixes, error handling in parser
Browse files Browse the repository at this point in the history
  • Loading branch information
sayon committed Aug 3, 2014
1 parent 6e572a5 commit 3689331
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 399 deletions.
215 changes: 0 additions & 215 deletions dwarf/dwarf-compiler/AST.c

This file was deleted.

2 changes: 0 additions & 2 deletions dwarf/dwarf-compiler/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ typedef enum {
AST_PRINT
} ast_node_type_t;



typedef struct {
struct ast_t* first;
struct ast_t* second;
Expand Down
7 changes: 2 additions & 5 deletions dwarf/dwarf-compiler/bytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ typedef signed long addr_offset_t;
typedef short reg_num_t;

extern size_t bytecode_size[];





typedef struct bytecode_t {
opcode_t opcode;
Expand All @@ -68,8 +66,7 @@ typedef struct {



bytecode_t* emit_bytecode( bytecode_builder_t* builder, opcode_t opcode );

bytecode_t* emit_bytecode( bytecode_builder_t* builder, opcode_t opcode );


/* Helpers to emit specific bytecodes with parameters */
Expand Down
15 changes: 12 additions & 3 deletions dwarf/dwarf-compiler/dwarf-compiler.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,26 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AST.h" />
<ClInclude Include="ast.h" />
<ClInclude Include="bytecode.h" />
<ClInclude Include="codegen.h" />
<ClInclude Include="common.h" />
<ClInclude Include="lang_types.h" />
<ClInclude Include="fileio.h" />
<ClInclude Include="lexer.h" />
<ClInclude Include="parser.h" />
<ClInclude Include="tokens.h" />
<ClInclude Include="token_list.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AST.c" />
<ClCompile Include="ast_constructors.c" />
<ClCompile Include="ast_helpers.c" />
<ClCompile Include="bytecode.c" />
<ClCompile Include="codegen.c" />
<ClCompile Include="lexer.c" />
<ClCompile Include="main.c" />
<ClCompile Include="parser.c" />
<ClCompile Include="tokens.c" />
<ClCompile Include="token_list.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
37 changes: 32 additions & 5 deletions dwarf/dwarf-compiler/dwarf-compiler.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,28 @@
<ClInclude Include="tokens.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="lang_types.h">
<ClInclude Include="common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="common.h">
<ClInclude Include="lexer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AST.h">
<ClInclude Include="parser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="lexer.h">
<ClInclude Include="bytecode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="codegen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ast.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="token_list.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="fileio.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand All @@ -41,7 +53,22 @@
<ClCompile Include="parser.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AST.c">
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bytecode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="codegen.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ast_constructors.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ast_helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="token_list.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
Expand Down
10 changes: 0 additions & 10 deletions dwarf/dwarf-compiler/lang_types.h

This file was deleted.

Loading

0 comments on commit 3689331

Please sign in to comment.