Ghezlan AL-Nofly
Ghezlan AL-Nofly

Reputation: 47

How to develop compiler without compiler writing tools

My teacher gave this question ( how to develop compilers without compiler writing tools ). I searched for it but I did not find anything. So, If anyone have any idea about this please help me. I found so many information about developing compiler with writing tools but I found nothing when I searched for without compiler writing tools.

Thank you in advance.

Upvotes: 0

Views: 408

Answers (2)

uliwitness
uliwitness

Reputation: 8773

A compiler is basically a filter/converter. It reads text files and outputs data that happens to be identical to the instructions the given CPU understands.

So you need to find out:

  • what assembler code your source language‘s commands are equivalent to
  • what byte sequences each of these assembler commands are equivalent to

Then you can read the source file and output compiled code.

Upvotes: 0

user207421
user207421

Reputation: 310840

With:

  1. Hand-written scanner (large switch statement), and
  2. Recursive descent parser.

Upvotes: 1

Related Questions