Giter VIP home page Giter VIP logo

lexer's Issues

如果再多一个语法分析就完美了

为什么没有早点遇到这个 demo , 幸苦写了词法分析器,结果一对比,发现自己写得有点捞了……

词法分析出了 tokens ,但生成 AST 树我就有点头疼了,语法分析有没有更为简洁而优雅一点的写法?就像你这个 demo 中的写法,我从没见过这种写法,优雅,确实优雅!!! 如果你能继续写个语法分析就完美了……

这是我自己的语法分析,目前还有很多没处理,像一些循环,选择等的逻辑还识别不出来,现在只能简单的识别一些比较简单的声明
image

有些疑问

image
没有学过编译原理,想问一下这种难道不需要做处理吗?字符串里面有诸如"或者注释符,或者注释符后面出现双引号,这都不需要处理吗?

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.