Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

计算机解析的套路 #71

Open
lovelmh13 opened this issue Jun 11, 2021 · 0 comments
Open

计算机解析的套路 #71

lovelmh13 opened this issue Jun 11, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

计算机解析的套路

  1. 词法分析器。这一步可能是经过状态机实现的。 比如浏览器解析 DOM 和 CSS
  2. 语法分析器生成 AST 或类似可方便转换的结构
  3. 转换
  4. 遍历 匹配。匹配时常用的方法:带上父节点来方便匹配
  5. 生成代码。逆向的转换

以上行为并不是固定不变的,但是编译的思路是这么个思路

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant