Configure | using in VS Code - AJ-comp/Compiler GitHub Wiki

Compiler (Basic Configure)

This project is about compiler including EBNF input system and parsing analysis tools and AJ language that system programming language.
IDE project is not supported more so don't build the projects in the Application folder.

Build the projects CommandPrompt.Builder and CommandPrompt.Util. The projects is the top layer projects of the system.
To use the compiler for AJ language in the VS Code follow the below sequence.

  1. Build the projects CommandPrompt.Builder and CommandPrompt.Util.
  2. Add to the environment variable the path that there is a ajbuild program. (ajbuild program is created after build CommandPrompt.Builder project.)
  3. Add to the environment variable the path that there is a ajutil program. (ajutil program is created after build CommandPrompt.Util project.)
  4. Execute the cmd and input ajbuild and ajutil. if you get screen as below then the configure is successed.

image

  1. Create solution file by input "ajbuild new --output [path to create sln file] sln". (ex: ajbuild new --output c:\ajtest sln).
  2. Create the start project file by input "ajbuild new --output [path to create ajproj file] start". (ex: ajbuild new --output c:\ajtest\test start).
  3. Add project file to the solution by input "ajbuild sln [solution path] add [the full path of project file to create])". (ex: ajbuild sln c:\ajtest add c:\ajtest\test).
  4. If you completed for now then your solution folder will be as below.

image

  1. Ok read the folder (the folder existing sln file) from VS Code.
  2. Create the tasks.json file.
  3. Type the below content (if your solution path is different change the content of red underline.)

image

  1. Add main.aj file (file name does not matter) in the project path as below.

image

  1. Build with ctrl + shift + b. if the result is as below then all configure is successed.

image

  1. Good, now let's programming with AJ language. Before start need a few library sources. Download from this (https://drive.google.com/file/d/1l8_JHT4MmAtxzy4Gr4zsD225vS5ZgVhL/view?usp=sharing) After download add to the project folder. the result is as below.

image

  1. AJ language is similar C#. click main.aj and let's type as below and build with ctrl + shift + b.

image

  1. Good, as above if syntax error or semantic error is fired the position that error fired shows.
⚠️ **GitHub.com Fallback** ⚠️