Skip to content

klephron/natrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Natrix

Dev-environment

Build:

docker build . -t zubrailx-natrix

Run container and execute commands inside:

docker run -v .:/workspace -it zubrailx-natrix:latest bash

Or run and connect with SSH:

docker run -v .:/workspace -itd zubrailx-natrix:latest

ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null \
    -p 2222 user@<ip>
  • ip - container ip

Default password for user user is user.

Cd to mounted workspace:

cd /workspace

Configuration

Make Targets:

make help
Targets:
  clean/build                 Remove build files
  clean/out                   Remove io output files
  compiler                    Build compiler executable
  debugger                    Build debugger executable
  format                      Format
  help                        Help
  index                       Index project
  run/asm                     Compile file
  run/dbg                     Run debugger
  run/pdf                     Run main executable and generate dot
  run/test                    Run all tests or specific
  test                        Build tests
  util                        Build libutil.a
  x86_64_core                 Build libx86_64_core.a
  x86_64_std                  Build libx86_64_std.a
Modules (prefixes of module targets):
  util compiler x86_64_core x86_64_std debugger test

Build compiler

make compiler

Build debugger

make debugger

Test

make run/test

Run assembly

Run default suite:

make run/asm

Run selected suite (for example io/suite28.txt):

make run/asm/io/suite28.txt

Run manually:

make x86_64_core x86_64_std

./build/compiler/main  \
        -o io/suite28.txt.asm \
        io/suite28.txt /workspace/src/x86_64_std/x86_64_std.txt

as --64 -g -o io/suite28.txt.asm.o io/suite28.txt.asm

ld -g -z noexecstack -o io/suite28.txt.asm.out \
        -dynamic-linker /usr/lib64/ld-linux-x86-64.so.2 \
        /usr/lib/x86_64-linux-gnu/crt1.o \
        /usr/lib/x86_64-linux-gnu/crti.o \
        -lc \
        io/suite28.txt.asm.o \
        /workspace/build/x86_64_core/libx86_64_core.a \
        /workspace/build/x86_64_std/libx86_64_std.a \
        /workspace/build/util/libutil.a \
        /usr/lib/x86_64-linux-gnu/crtn.o

Help:

./build/compiler/main -h
Usage: ./build/compiler/main [options] <file>...
Options:
-d <directory>   - output directory (current: .)
-o <file>        - main output file (current: a.asm)
--tee            - print to file and to stdout (current: 0)
--ignore-errors  - continue execution on errors (current: 0)
--ast            - add AST output (current: 0)
--cfg            - add global subroutines control flow graph output (current: 0)
--cfg-add-expr   - include expressions in control flow graph (current: 0)
--cg             - add global subroutines call graph output (current: 0)
-s <subroutine>  - set or add global subroutine for call graph generation (current: main)
--hir-tree       - print HIR tree (current: 0)
--hir-symbols    - print HIR symbol table (current: 0)
--hir-types      - print HIR type table (current: 0)
--mir            - print MIR tree (current: 0)
-h
--help           - show help

Run debugger

Run with default init file:

make run/dbg

With specific init:

make run/dbg/io/dbg_init.txt

Run manually:

./build/debugger/main

Help:

./build/debugger/main -h
Usage: ./build/debugger/main [options] <file>...
Options:
-i <file>  - init file (current: (null))
-h         - show help

About

Natrix: a compiled, dynamic, strongly typed general purpose language.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published