Giter VIP home page Giter VIP logo

compiler's Introduction

Compiler

一个针对tiny语法进行词法分析和LL(1)的语法分析器

  • index对测试文本逐行读取进行词法分析,将词法分析结果以文件的形式保存在tokens.txt文件中
  • makeProduction对文法的产生式进行处理,利用removeLeftRecursion来消除文法的左递归,利用getFirstCollection来获取每一个非终结符号的First集合
  • getFollowCollection获取每一个非终结符号的Follow集合
  • makePredictiveAnalysisTable来构建预测分析表
  • parse利用预测分析表判断语法是否正确
  • index.html实现页面可视化效果

使用

  1. 全局安装json-serve

  2. 针对生成好的table.json(预测分析表),productionsTest.json(产生式集合)启动json-serve服务

    json-server --watch --port 3001  table.json
    json-server --watch --port 3002 productionsTest.json

compiler's People

Contributors

sunyiwen avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.