Coder Social home page Coder Social logo

compiler's Introduction

compiler

project

  • craft-ast:

手写 AST,实现一个简单的计算器

  • antlr-ast:

使用 antlr4 来实现 AST,实现一个简单的计算器

# 生成 AST 代码
antlr4 CommonLexer.g4 -o /Users/ooooo/Code/Self/compiler/antlr-ast/src/main/java/com/ooooo/antlr4 -visitor
antlr4 PlayScript.g4 -o /Users/ooooo/Code/Self/compiler/antlr-ast/src/main/java/com/ooooo/antlr4 -visitor
  • play-script-java

PlayScriptCompiler: 入口类

mac:

# 设置环境变量
export CLASSPATH=".:/Users/ooooo/Code/Self/compiler/libs/antlr-4.9.3-complete.jar:$CLASSPATH"
alias antlr4='java -Xmx500M -cp "$CLASSPATH" org.antlr.v4.Tool'
alias grun='java -Xmx500M -cp "$CLASSPATH" org.antlr.v4.gui.TestRig'

# 生成 AST 代码
antlr4 PlayScript.g4 -o /Users/ooooo/Code/Self/compiler/play-script-java/src/main/java/com/ooooo/antlr4 -visitor

windows:

SET CLASSPATH=.;C:\Javalib\antlr-4.10.1-complete.jar;%CLASSPATH%

compiler's People

Contributors

ooooo-youwillsee avatar

Stargazers

Roman Hossain Shaon avatar

Watchers

 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.