A Simple Syntax-Directed Translator

发布时间 : 2021-08-01
发布 : 2021-08-01 分类 : Note 浏览 :

Definition of Grammars

A context-free grammar composed of:

  • A set of terminal symbols referred to as “tokens”.
  • A set of nonterminals called “syntactic variables”.
  • A set of productions, where each production consists of a nonterminal, called the head or left side of the production, an arrow, and a sequence of terminals and/or nonterminals, called the body or right side of the production.
  • A designation of one of the nonterminals as the start symbol.

编译原理

发布时间 : 2021-07-20
发布 : 2021-07-20 分类 : 笔记 浏览 :

词法分析

词法分析的主要任务:

从左向右逐行扫描源程序的字符,识别出各个单词,确定单词的类型,并将识别出的单词转换成统一的机内表示——词法单元token形式。

token: <种别码,属性值>

e.g. 词法分析后得到的token序列:

输入:while(value != 100) {num++;}

输出:

  1. while < WHILE, - >
  2. ( < SLP, - >
  3. value < IDN, value >
  4. != < NE, - >
  5. 100 < CONST, 100 >
  6. ) < SRP, - >
  7. { < LP, - >
  8. num < IDN, num >
  9. ++ < INC, - >
  10. ; < SEMI, - >
  11. } < RP, - >

Swift开发学习

发布时间 : 2021-07-05
发布 : 2021-07-05 浏览 :

创建一个新的APP

在Xode的欢迎界面中,点击 Create a new Xcode project 创建新项目。模板选择器可以帮助你利用预设模板创建新项目,在 macOS 选项卡中你可以看到四种不同的核心macOS app类型:

  • App: 基于窗口UI的macOS桌面应用,Cocoa是所有macOS应用程序的框架。
  • Document App:
  • Game: 基于苹果SpriteKit或SceneKit框架的游戏程序。
  • Command Line Tool: 基于命令行文本UI,在shell中运行的实用工具。

选择 App 并点击 Next,在下一界面中设置产品名称为 HelloWorld,其他保持默认。

最后再点击 Next,并选择你要保存项目的位置。

Swift 的 playground 就像是一个可交互的文档,它是用来练手学swift的,写一句代码出一行结果(右侧),可以实时查看代码结果,是学习swift语言的利器!

Logging

发布时间 : 2021-06-24
发布 : 2021-06-24 分类 : 笔记 浏览 :

Introduction

Log is used to record the history of database changes securely.

The transaction is the unit of execution of database operations.

In the typical embedded SQL system, transactions begin as soon as operations on the database are executed and end with an explicit COMMIT or ROLLBACK (“abort”) command.

How transactions interact with the database? There are 3 address spaces that interact in important ways:

  1. The space of disk blocks holding the database elements.
  2. The virtual or main memory address space that is managed by the buffer manager.
  3. The local address space of the transaction.

事务的定义:

  • 一个数据库操作序列
  • 一个不可分割的工作单位(atomic)
  • 恢复和并发控制的基本单位

The SQL statement COMMIT causes a transaction to complete, database modifications are now permanent in the database.

The SQL statement ROLLBACK also causes the transaction to end, but by aborting. Having no effects on the database. It caused by failures like division by 0 or a constraint violation.

MIPS汇编语言编程

发布时间 : 2021-06-13
发布 : 2021-06-13 浏览 :

数据链路层

发布时间 : 2021-06-13
发布 : 2021-06-13 分类 : 笔记 浏览 :

约束与触发器

发布时间 : 2021-05-10
发布 : 2021-05-10 分类 : 笔记 浏览 :

网络层

发布时间 : 2021-05-09
发布 : 2021-05-09 分类 : 笔记 浏览 :

传输层

发布时间 : 2021-05-03
发布 : 2021-05-03 分类 : 笔记 浏览 :

Java复习

发布时间 : 2021-04-10
发布 : 2021-04-10 分类 : 笔记 浏览 :