Source Code
- Parsing step (scanned, split up, groped) aka. lexical (isolation from the sentence containing it) analysis. (grammar or meaning of text not taken into context. Just the meaning of the words themselves)
Lexical Analysis phase
1 Scans code
- Source text is considered as a chunk of string text.
- scanner reads the text one character at a time.
- for each char. it marks the line and position of where the character was found in source text.
2 Evaluates (lexing/tokenization)
- the lexer/tokenizer determines what type of token it has found

Example of how compiler lexes a phrase

token
- represented as a pair consisting of a token name and some (optional) value
lexemes
- words of a program
- substring of source code.
- grouping of smallest sequence of characters.

출처
https://medium.com/basecs/reading-code-right-with-some-help-from-the-lexer-63d0be3d21d
728x90
'800===Dev Docs and License > 이론 문서' 카테고리의 다른 글
클린 코드 작성 - 3단계로 완성하는 효율적이고 깔끔한 코드! ✨ (0) | 2024.06.01 |
---|---|
Network Subnet Introduced (0) | 2024.05.29 |
소프트웨어 크랙 (해적본)은 어떻게 만들고 개발자들은 왜 못막는 걸까? (0) | 2024.05.25 |
만들면서 배우는 클린 아키텍쳐 (1) | 2024.05.25 |
CORS 이해 및 설명 (0) | 2024.05.25 |