⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 用YACC实现的一个小的编译工具
💻
字号:
EXAMPLE 1: TREESThis initial examples introduces the basic concepts of Memphis.Domain declarations introduce data types by listing alternativeways to construct hierarchical values values.Match statements allow the processing of these values by giving rules forthe alternatives. Rules are selected by matching a value against a posiblynested pattern.The example defines a data type Tree and function that traversesvalues of this type.EXAMPLE 2: SUBTYPESThis example program shows how values of domain typesmay be used like objects.The "->" notation can be used to access and update their fields.Subtypes allow to manipulate the fields in type-safe wayoutside of match statements.The example uses the Tree type from Example 1 and gives functions toupdate the fields of a node.Note that the possibility to update fields introduces the fullpower of general graph structures.EXAMPLE 3: MULTIThis example shows how to process multiple file programs.The TREES example is splitted into two files:`treedef.m' provides the domain definition,`treeuse.m' contains a match statement that processes Trees.EXAMPLE 4: INTERThis example shows how Memphis can be used to describe and processabstract syntax trees. The cooperation with Lex and Yacc is demonstrated.The example implements an interpreter for a tiny programming langauge.EXAMPLE 5: POLISHThis example shows how Memphis can be used to processGentle structures in C/C++ code.Like Memphis, Gentle supports domains types and pattern matching.Unlike Memphis, Gentle provides a high level of abstraction to expresslanguage recognition, transformation, and code generation in a uniform way. Combining Gentle and Memphis allows one to use a specialized andproductive compiler description language for the translation tasks of anapplication, and also to use C/C++ programming e.g. to implement the userinterface.  Memphis enables seamless integration of Gentle and C/C++.The example defines a domain type for symbolic expressionsand gives a grammar to construct these expressions from linear input.It gives two procedures to emit such expressions in "polish" and in"reverse polish notation". The first procedure is a Gentle predicate,the second one is a Memphis function.(Requires Gentle 98 or higher)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -