Developer FAQ - axkr/symja_android_library GitHub Wiki

How can I interactively execute the Symja language?

  • two REPLs are available in the library a Console.java for standard math input and a MMAConsole.java for Mathematica like syntax input.

Where can I find the documentation of built-in functions in the repository?

  • you can find it in the /doc/functions folder
  • the language documentation can be found in the /doc folder

Where are the built-in function implementations in Java?


How can I define a new Symja built-in function name in Java?


Where are the main basic transformation rules defined?


Where are the parsers defined?

  • in package org.matheclipse.core.parser the main ExprParser class is implemented to transform an input string directly to an IExpr object
  • the basic parser structures are defined in package org.matheclipse.parser.client this Parser can be used on the client side without the whole Symja stuff. Inside Symja the AST2Expr class is used to transform the client side ASTNode into an IExpr.
  • all operators and their affix, associativity, and precedence are defined in the ASTNodeFactory class
  • another "fuzzy parser" FuzzyParser.java is implemented for the parsing of JSON API input queries.

Where is the structural pattern-matching implemented?


Where are the main JUnit tests located?


How can I prepare an IDE to work on Symja source code?

  1. Select and install an IDE of your choice and create a new workspace for Symja.
  • If you want to work with Eclipse the package Eclipse IDE for Java Developers provides everything you need.
  • If you prefer another Eclipse package make sure you have Eclipse JDT and the Eclipse Maven integration (m2e) installed.
  1. Clone the repository you want to work with to your computer and add it to your IDE.
  • It is recommended to create a fork and clone your fork if you want to contribute to Symja, but it is also possible to clone this repository directly.
  • If you are not yet familiar with the usual github work flow for contributions, consider to read this GitHub article.
  1. Import all Maven modules in your Symja clone to your IDE.
  • In Eclipse it is recommended to do this via File -> Import... -> Git -> Projects from Git (with smart import) -> Click Next -> Existing local repository -> select your local Symja clone and click Next. -> Select all folders except for the root folder.
  • In Eclipse it is additionally recommended to enable automatic Maven project configuration via Window -> Preferences -> Maven -> Automatically update Maven project configuration (which is currently an experimental feature of m2e). Additionally you could consider to enable automatic download of artifact sources and java-doc. If you don't want to enable automatic project configuration update, you have to trigger the project configuration update manually via right click on the project -> Maven -> Update Project ...

What is the preferred Java code formatter?

  • The Google Java Formatter, which reformats Java source code to comply with Google Java Style, is used for formatting Java source codes.

  • Equivalent Google Java Style Formatter configurations for Eclipse and Intellij are also available and can be imported into the corresponding IDE.

    • In Eclipse you can import the downloaded configuration via Window -> Preferences -> Java -> Code Style -> Formatter -> Click on Import... and select the downloaded configuration file.

How can I build Symja locally on my computer?

  • On the command line run the following Maven command from the root of this git repository's local clone: mvn clean verify -f symja_android_library

    • In Eclipse you can just run the symja--build launch-configuration

This compiles all Symja modules, executes all tests and builds all jars including runtime, source and java-doc jars.


How can the Maven dependencies be used with Gradle