GitXplorerGitXplorer
b

Mu

public
114 stars
44 forks
0 issues

Commits

List of commits on branch master.
Verified
0d4af0529b363d480c056b6bb6de3ad2e77c84fe

Added link to forked repo

bbkiers committed 4 years ago
Unverified
f51b79148793d62c9501fafb93debdcc99032d76

Fixed operator precedence by grouping [+ -], [* / %], [< <= > >=] and [== !=] into single rules.

committed 10 years ago
Unverified
f379faf466511bf0bf916de8ef1d8856b6b699db

Mavenized the project, removed Ant build file.

bbkiers committed 11 years ago
Unverified
d9564916bbb67fb738c3fedbea7a5d8642ec6896

Update README.md

bbkiers committed 11 years ago
Unverified
54a18cbf5b061c8e7be6818c36522bd876cc0b60

Update README.md

bbkiers committed 12 years ago
Unverified
779ed2244818861f1d1f100336298afcc5672fb4

Updated README.

bbkiers committed 12 years ago

README

The README file for this repository.

Mu

A small expression parser, using ANTLR 4. It supports most basic operators and while- and log- (print) statements. It is just a basic demonstration of how to use the -visitor functionality of ANTLR 4.

To run the demo script:

n = 9;

while n > 0 {

  # expressions can be surrounded by parenthesis, of course
  if (n % 2 == 0) {
    log n + " -> even";
  }
  else {
    log n + " -> odd";
  }

  n = n - 1;
}

do:

git clone git://github.com/bkiers/Mu.git
mvn clean install
mvn -q exec:java

which will print the following to your console:

9.0 -> odd
8.0 -> even
7.0 -> odd
6.0 -> even
5.0 -> odd
4.0 -> even
3.0 -> odd
2.0 -> even
1.0 -> odd

Also see this stackoverflow Q&A.

@w3b-net-au made a fork including for- statements: https://github.com/w3b-net-au/Mu