acwj
acwj copied to clipboard
A Compiler Writing Journey
after introducing array, code generator for arm seems not changed. And make armtest,input20 also fails with Segmentation fault. I guess function cgglobsym in cg_arm.c requires change.
I tired to port the compiler to Windws but there are some errors: Generated out.s does not compile correctly on Windows. GAS(the AT&T asm) on Windows don't work identical, it...
```cpp int foo; void foo(); ``` On GCC, this gives: ``` test.c:2:6: error: ‘foo’ redeclared as different kind of symbol 2 | void foo() {} | ^~~ test.c:1:5: note: previous...
Trying to compile this code: ```cpp struct node { int count; struct node *left; } words[14]; ``` Makes cwj (at least the one from chapter 62) hang forever. This seems...
After introducing new tokens, many places need modification of course. It's not hard for someone to realize we need to change `defs.h` and `scan.c`, but some files are easily ignored...
I believe the precedence of arithmetic operations must have greater value than ones of comparison operator. (In `OpPrec[]`) For example, if input was, ``` print 1 + 2 < 4...
please write example for llvm frontend and generating normal exe elf file
My test file demo.c are as follow. ``` c int main() { int a; char c; a = 1; c = a; return (1); } ``` I run make, then...
Hi, thanks for the excellent content of the book! I have really learned a lot from it. However, when I was reading **Part 3: Operator Precedence**, the error message came...