After you clone this reposity, you just need to run my shell script : )
bash install.sh
Note:
PJDCC can compile code to x86 assembly. I borrow nasm to assembly, gcc's ld to link. So I will install nasm and gcc for you at first.
Just like install, I have write a shell script for you :
bash uninstall.sh
PJDCC's usage is very easy.
pjdcc [-ESTA] input_file
-E: Generate executable file (default)
-S: Compile to assembly file
-T: Scan the code, print tokens
-A: Parse the code, print abstract syntax tree
Note:
You don't need to input out_file's name.
If you pjdcc [-E] xxx.c, I will generate the executable file named xxx.
If you pjdcc -S xxx.c, I will generate the x86 assembly file named xxx.s.
- Basic Type: char(1byte), int(4byte), long(8byte), void(Function can return)
- Pointer Type: One dimension pointer of Basic Type, char*, int*, long*
- Array: One dimension array of Basic Type, char[], int[], long[]
- Type: return Basic Type and Pointer Type
- Parameter: Basic Type and Pointer Type
- Support recursion function call
- Basic Type and Pointer Type support global variable and local variable
- Array only support global array
- Support initialize, global array can use initialized list
- Selection Statement: if and if-else, if else-if else-if...
- Iteration Statement: while, do-while, for
- Continue and Break
- Function Return
- Comma Expression: xxx,xxx,xxx
- Assignment: identifier=xxx; *identifier=xxx; identifier[xxx]=xxx;
- Ternary: xxx ? xxx : xxx
- Logical Or And Not: || && !
- Bit Or Xor And Not: | ^ & ~
- Relational: == != < <= > >=
- Shift: << >>
- Arithmetic: + - * / %
- Increment Decrement: ++ --
- Sizeof: sizeof(Type) sizeof(identifier)
- Single-line: //xxx
- Multi-line: /* xxx */
Because I don't implement preprocessor and library, so I create this Keyword--kiss : )
If you use printf and scanf, I will help you link with standard library automaticly
But If you want to use other library's function, you need to "kiss" declare it
kiss strlen;
int main()
{
char* s="Baby,Kiss me!";
printf("len=%d\n",strlen(s));
return 0;
}