Code Monkey home page Code Monkey logo

pascal_to_c's Introduction

Pascal_to_C

Pascal-S语言编译为C语言的程序的设计与实现。
按照所给出的Pascal-S语言文法,设计将其编译为C语言的程序。

lex-yacc-src:
lex.l:lex生成源文件
yacc.y:yacc生成源文件

src:
main.h,main.cpp:主程序
lex.yy.cpp:lex执行文件
yacc.tab.h,yacc.tab.cpp:yacc执行文件
syntaxAnalyse.h,syntaxAnalyse.cpp:语法分析(yacc以外部分)执行文件
semanticAnalyse.h,semanticAnalyse.cpp:语义分析执行文件
codeGeneration.h,codeGeneration.cpp:代码生成执行文件

运行环境
1.词法分析器:flex
2.语法分析器:bison
3.整体工程语言:C++14
4.整体工程运行环境:windows Clion2022.1

1.确保自己的电脑上安装有gcc
2.使用clion打开code/src/main.cpp,或者其他具有c++14以上环境的ide打开
3.如果使用clion打开,请将需要执行的代码(命名为PascalProgram.pas,或者在代码中修改相应命名)移到cmake-build-debug中
4.运行程序,输出代码在test.c中

pascal_to_c's People

Contributors

xuyifan-0731 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.