Skip to content

A programming language named Ava. Including a lexer and a parser.

License

Notifications You must be signed in to change notification settings

TriangleABCD/Ava-Language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ava-Language

  • 开发环境

    ubuntu 20.04
    C++ 17
    CMake >= 3.10

代码架构

./
	README.md
	报告
	ava_lexer/
		CMakeLists.txt
		include/
		src/
	ava_parser/
		CMakeLists.txt
		include/
		src/
	demo/
		regular_grammar.txt
		demo.ava
		2grammar.txt
		visual.py
		ava_lexer
		ava_parser

词法分析器

生成可执行文件

cd ava_lexer
mkdir build && cd build
cmake ..
make

demo 测试

cd demo
./ava_lexer regular_grammar.txt demo.ava

结果输出至控制台

cd demo
./ava_lexer regular_grammar.txt demo.ava -o

输出 DFA

cd demo
./ava_lexer regular_grammar.txt demo.ava -v

DFA 可视化

cd demo
./ava_lexer regular_grammar.txt demo.ava -v | python visual.py
  • python 依赖

    pip install graphviz

语法分析器

生成可执行文件

cd ava_parser
mkdir build && cd build
cmake ..
make

demo 测试

cd demo
./ava_lexer regular_grammar.txt demo.ava
./ava_parser 2grammar.txt tokens.txt

输出中间过程和表

cd demo
./ava_lexer regular_grammar.txt demo.ava
./ava_parser 2grammar.txt tokens.txt -v

About

A programming language named Ava. Including a lexer and a parser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published