Skip to content

FerrisChi/compile_exp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compile_exp

Making c\c++ compiler

1_lexical

A lexical analysis program aimed for C\C++ program.

A C++ version is presented in c_lex\ and a Lex version is presented in lex\.

Lex version is in this experiment is a modified version of ANSI C grammar, Lex specification. click here.

Yaac is supposed to be accompanied with the matching lex file. That's the work to do at next stage. click here

Reference:

c++ version:

​ GitHub in ref\

Microsoft Ignite

lex version:

lex入门

lex网络教程

另一个示例

parser

A syntactic parser of arithmetic expression with + - * / ( )

A C++ version with cmake in parse\ and a Yacc version in yacc\

In C++ version:

  • Recursive analysis is intended for example grammar.
  • LL(1) analysis and SLR(1) is intended for arbitrary grammar.
  • Not eliminate left-recursion yet. To avoid the endless loop, grammar must have no left-recursion in productions when doing LL(1) and recursive analysis.

Reference:

c++ version:

消去左递归

c++ template

yacc version:

ANSI C grammar, Lex specification. ANSI yacc(2011版)

Yacc介绍

About

Making a c\c++ compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published