implement lexical analysis function for c-minus

This commit is contained in:
2025-10-02 07:14:04 +09:00
parent 87931e8cc2
commit 9af73c5a15
9 changed files with 600 additions and 354 deletions

View File

@@ -1,9 +1,41 @@
컴파일러 1
===
# ISA & Compiler Basics
## Basic Computer
To get a task done by a general-purpose computer, we need:
* Program: A sequence of instructions
* Instruction set: A set of possible instructions
### Von Neuman Architecture
Both Instructions and data are stored in the memory.
Instructions dictate:
1. which and how data are manipulated
2. which instruction should be next
The memory is independent of the CPU.
# Interpreter in Modern Processors
### How to load a program
```
*.c -(compiler)-> *.s: Assembly program
*.s -(assembler)-> *.o: Object file
*.o -(linker)-[with library(*.o)]-> *.exe: Executable
*.exe -(loader)-> to in memory
```
### Program
Computer is essentially a complex state machine.
**programmer visible state**:
* Memory
* Registers
* Program Counter
Instructions(Program) specify how to transform the values of programmer visible state.
# Compiler