Questions tagged [tiger]

Use this tag for questions about the programming language Tiger, a small imperative language derived from a language introduced by Andrew Appel in his book "Modern Compiler Implementation". Use the tag [osx-tiger] for questions about the fifth release of Apple's operating system for Macintosh computers. Use the tag [tiger-census] for questions about the Topologically Integrated Geographic Encoding and Referencing census data format (TIGER).

Tiger is a small imperative language derived from a language introduced by Andrew Appel in his book "Modern Compiler Implementation".

Tiger is currently maintained by the Research & Development Laboratory (LRDE) at l'École de l'Intelligence Informatique (EPITA).

Resources

12 questions
9
votes
3 answers

Writing unit tests in my compiler (which generates IL)

I'm writing a Tiger compiler in C# and I'm going to translate the Tiger code into IL. While implementing the semantic check of every node in my AST, I created lots of unit tests for this. That is pretty simple, because my CheckSemantic method looks…
Oscar Mederos
  • 29,016
  • 22
  • 84
  • 124
7
votes
1 answer

Using Ocamllex for lexing strings (The Tiger Compiler)

I'm trying to follow Appel's "Modern Compiler Implementation in ML" and am writing the lexer using Ocamllex. The specification asks for the lexer to return strings after translating escape sequences. The following code is an excerpt from the…
nimrodm
  • 23,081
  • 7
  • 58
  • 59
3
votes
3 answers

Target architecture for Tiger-compiler

I am writing a Tiger compiler in F# and I have finally reached the point where I can no longer postpone the decision of a target architecture. This is my first compiler, but it will definitely not be my last. So... what would be a good target…
Jørgen Fogh
  • 7,516
  • 2
  • 36
  • 46
1
vote
1 answer

Definition in Standard ML implementation file is externally visible (but not in the signature file)

I'm converting SML starter code from the Tiger book to OCaml. What's confusing me is that, in the signature file table.sig (below), there is no mention of IntMapTable, but the functor is accessible in another file without any qualification. (*…
MattDs17
  • 401
  • 1
  • 4
  • 20
1
vote
0 answers

Tiger language parser for compiler

I am now trying to build a compiler using the book Modern Compiler Implementation in C (the Tiger book). I am now stuck in the parser phase. I have built my grammar and tried to run it but still get some syntax error. I tried my lexer and it appears…
1
vote
2 answers

ML-Yacc Tiger Parser Reduce/Reduce error

I am going through the Ch3 programming exercise of generating a Tiger Parser in Appel's "Modern Compiler Implementation in ML" book. My tiger.grm file is here. The error I am trying to diagnose is a reduce-reduce conflict arising from rules for…
aspen100
  • 965
  • 11
  • 22
0
votes
1 answer

Modern Compiler Implementation in ML - Having issues with the register allocator wanting to coalesce the frame pointer and various temporaries

I can't quite figure out why the register allocator considers the frame pointer a good candidate for node coalescing - it should interfere with every other temporary and therefore any move involving the frame pointer should be constrained. For…
Bridge
  • 105
  • 1
  • 8
0
votes
1 answer

How can I resolve this shift-reduce conflict?

I'm following Appel's book Modern Compiler Implementation in ML and am trying to write a grammar for Tiger. Here's my first attempt: %% %term EOF | ID of string | INT of int | STRING of string | COMMA | COLON | SEMICOLON | LPAREN |…
Bridge
  • 105
  • 1
  • 8
0
votes
2 answers

I need a configurable IDE for my personal Tiger Compiler?

I made a tiger compiler, so i need a simple IDE to configure it to work with my compiler, I thought using Notepad++ but I couldn’t find a way to underline or mark the errors on the text. Any suggestions???
David Darias
  • 570
  • 6
  • 9
0
votes
0 answers

Why tiger(Modern Compiler Implementation) use `fundecs` in chapter 4 instead of `fundec`?

I'm following the tiger book to write a compiler. In chapter 3, based on the github's code and my understanding, I filled in the following rules for the dec: decs: %empty | decs dec ; dec: tydec | vardec | fundec ; tydec: …
Shore
  • 827
  • 9
  • 24
0
votes
1 answer

ML-Yacc Tiger Parser not properly parsing lvalue

I'm working on the parser component of my Tiger compiler in SML using ML-Yacc. I cannot find any glaring problems with my grammar file (I've used priority rules to resolve all shift-reduce conflicts) but it seems to never reduce using the second and…
MattDs17
  • 401
  • 1
  • 4
  • 20
0
votes
1 answer

Antlr, rule which could result the same as another

For a compilation project, my group and me are defining a grammar with Antlr. We have currently a problem with theses rules : expr: ... | lvalue expr3 expr2 | ID '('exprList')' expr2 |... ; lvalue: ID lvalue2; lvalue2: '.' ID lvalue2 | '['…
Cédric Rémond
  • 954
  • 1
  • 8
  • 20