287mdsahil / lexical_analyzer

JU BCSEIII Compiler Design Project
GNU General Public License v3.0
3 stars 0 forks source link

Structure and Compilation #3

Open pmcarpan opened 4 years ago

pmcarpan commented 4 years ago

Some help regarding the project structure, java packages, and compilation.

Oracle references: here.

Structure

syntax_analyzer/
    src/ // this will contain java sources, subfolders in here denote packages
        package1/
        package2/
    bin/ // use this to hold the compiled `.class` files, but do not upload them!

Compilation

Follow the above folder stucture. For compilation use javac.

I use the following command:

syntax_analyzer>javac src/regex/Regex.java -cp src/ -d bin/ -encoding utf-8

Note the utf-8 encoding.

Running

Use the java command. Link the compiled binaries in the classpath. Refer to classes by their fully qualified package name before the class name.

syntax_analyzer>java -cp bin/ regex.Regex "(a|b)*abc"