januwA / xxscript

script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xxscript

./x64/Release/xxscript.exe -i ./test.xxs -jit

./x64/Release/xxscript.exe -i ./test.xxs -print

编译命令

$ ./x64/Release/xxscript.exe -i test.xxs [options]

options:

  • -jit 执行代码
  • -ir 打印LLVM IR
  • -pass 开启函数优化
  • -parser 测试语法解析器

Number

1       i64 
1.2     f64 

Bool

true  i64
false i64

Function

function name(p1, p2) {
  return 1 + 1;
}

name(1,2)

if

if() {

} else if() {

} else {

}

for

for(;;) { }

for(i=0; i<10; ++i) { }

for(i=0; i<10; ++i) {
  if(i==5) break;
}

for(i=0; i<10; ++i) {
  if(i==5) continue;
}

while

while(true) { break; }

string

print(`hello {}`, `word`);

三元表达式

print(0 ? `true` : `false`);

About

script


Languages

Language:C++ 93.4%Language:Yacc 4.2%Language:Lex 1.4%Language:LLVM 0.9%