看书学习中做一些笔记, 长期填坑
主要看虎书和编译原理与实践
学习编译原理, 做一些记录
License: MIT License
看Compiler Construction Principles and Practice, 在第131页底部, 感觉言简意赅
We have been using the term context-free without explaining why such rules are in fact "free of context." The simple reason is that nonterminals appear by themselves to the left of the arrow in context-free rules. Thus a rule A->α says that A may be replaced by α anywhere, regardless of where the A occurs.
我们已经用了词: 上下文无关, 而没有解释为什么这样的规则事实上就是"和上下文没有关系的". 简单的理由是: 非终结符自身在上下文无关规则的箭头左边.
于是, 若有一条规则: A->α, 则意味着A可能会在任何地方被α替换, 无论A在什么位置出现.
平时说话经常会用代词指代东西, 代词就是上下文有关的, 不然无法判断其指代, 而某个名字往往就是上下文无关的, 这个名字直接被理解为其对应的事物
比如: 那个男人, 可以有多个理解, 需要上下文, 而书就明确被大脑接收并替换为"书"这种东西
摘抄于一张 Compiler Construction: Principles and Practice 里的流程图
Source Code 源码
|
Scanner 代码扫描器, 读入代码
|
Tokens 输出一个个词
|
Parser解析每个词
|
Syntax Tree 生成语法分析树
|
Semantic Analyzer 语义分析
|
Annotated Tree 带语义注释的树
|
Source Code Optimizer 源码优化器
|
Intermediate Code 中间代码
|
Code Genrator 代码生成器
|
Target Code 目标代码
|
Target Code Optimizer 目标代码优化器
|
Target Code 目标代码
相关网站:
用途:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.