Skip to content

Latest commit

 

History

History
131 lines (85 loc) · 2.81 KB

README.md

File metadata and controls

131 lines (85 loc) · 2.81 KB

image

High Level Overview

image

Dependencies

OpenKittenCAD is built on the shoulders of giants.

I am a true believer that for a project to be maintainable in the long term we have to keep as little dependancies as possible. This project depends on the following dependancies

  • Flex
  • Bison
  • OpenCascade
  • VTK (Soon to be removed as a dependent)

⚠️ Note: Not listing any of the dependancies dependances!

Grammar

#---------------------------------------
# Statements
#---------------------------------------

stmt      : block
          | functionStmt
          | declStmt
          | exprStmt
          | returnStmt


stmtList  : stmtList ';' stmt
          | stmt

#---------------------------------------

functionStmt    : 'fn' ID '(' paramDeclList ')' [ '->' TYPE ]? block

returnStmt      : 'return' expr

declStmt        :  ID ':' TYPE initOpt

exprStmt        : expr

block           : '{' stmtList* '}'

paramDeclList   : empty
                | paramDeclList ',' paramDecl
                | paramDecl

paramDecl       : ID ':' TYPE

initOpt         : [ ':=' expr ]?


#---------------------------------------
# Expressions
#---------------------------------------


expr            : expr binaryOpr expr
                | NUM 
                | TRANS 
                | ID 
                | ID '(' argList ')'

argList         : empty
                | argList ',' '%'
                | argList ',' expr
                | expr 
                | '%'
    


# Binary operators :
#   Pipe          : '|>'
#   Math          : '+' '-' '*' '/' 

CheatSheet

cheatsheet

Examples

examples

Contributing

If you are wanting to contribute a good start is Roadmap. If you find a issue please open a github issue. If you wish to make a PR please open a github issue and link it with it. Unless its a change like grammar fix. There is still a lot of work to be done. I work full time so progress on the project may be "slow". :)

Building

Specifiable Arguments

Variable Name Variable Type Description
VTK_DIR_ARG PATH Path to the VTK directory
OpenCASCADE_DIR_ARG PATH Path to the OpenCASCADE directory
BUILD_TEST BOOL Enable or disable testing
BUILD_MAIN BOOL Enable or disable the main build

Linux

$ mkdir build 
$ cd build
$ cmake [-options] ..
$ make
$ ./src/back-end/driver {path to .kts file}

Windows


Mac