Giter Club home page Giter Club logo

moeantlr's Introduction

Test parser for Moe written with Antlr4

command line:

antlr MoeLexer.g4 MoeParser.g4 -listener -visitor -o Moe -Dlanguage=Cpp 

Moe syntax changes to make things more regular:

  • add colon before optional loose type in enums
  • switch case shouldn't use colon to end the case, (wrap the symbol in parens?) ie. case (22) return foo case (21,23) break it probably makes more sense to switch to curly bracing case 22 { return foo } case 21, 23 { break }

h2. MoeFormat

  • maximum line length enforcement
  • Allman brace style (ensure newline after declaration, brace then newline, then zero newlines before comment or code)
  • except single line (ensure all cases match the single line requirement?)
  • decl has space after the identifier, colon with no space before type
  • space after pointers or qualifiers inside decl
  • space after proc before '('
  • space before and after '->' arrow in return type
  • space before and after operators
  • remove unneeded semicolons
  • replace c-style pointer dereference '->' with moe style '.'
  • replace c-style enum constant initializer '=' with ':='
  • replace four spaces with tabs
  • clean up trailing commas in enum constant list
  • no space before array (after primary_exp)
  • tab alignment
  • - enum constant values
  • [ ] - single line switch bodies

  • Optional hungarian warnings
  • - missing tags
  • - pointer types need p? does this need a typechecker?

moeantlr's People

Contributors

evcholesky avatar

Stargazers

Devspace 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.