502
订阅者
无数据24 小时
+57 天
+8030 天
帖子存档
502
Lexer, parser, and visitor are three important components of a compiler or interpreter.
A lexer (short for lexical analyzer) is responsible for breaking down the input source code into a sequence of tokens. Tokens are the smallest units of meaning in a programming language, such as keywords, identifiers, operators, and literals.
A parser is responsible for analyzing the sequence of tokens produced by the lexer and constructing a parse tree, which represents the syntactic structure of the program. The parse tree is a hierarchical structure that shows how the different parts of the program are related to each other.
A visitor is a design pattern that is often used in conjunction with a parse tree. A visitor allows you to traverse the parse tree and perform some operation on each node. For example, you might use a visitor to evaluate the value of an expression, or to generate code for a particular target platform. The visitor pattern separates the algorithm from the data structure, making it easier to add new operations without modifying the existing code.
502
I've given up on lua, but reading extensively on lua and all opensource languages I wanted to build a language from scratch.
502
I plan to add class() to lua, because lua is a pop language and not an oop like python, java
502
when you want to compile an open source program, it's like this, I waited for 2 hours and he said checking,
this is python
