Skip to content

enoua5/grapejuice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

not that Grapejuice

The Grapejuice you're looking for is on Gitlab. This is just a dumb barely-working project I made as a teen.

grapejuice

Please note: I created this to see how it would be like to create a simple programming language, and as such it is not recommended that you use this for anything more than a couple laughs

Grapejuice installer for linux
Grapejuice is a language that I made, which compiles into c++
My friend is currently working on a Windows version

INSTALLATION:

In terminal, as root user, cd to grapejuice_release file. from here, run "source installer"

USE OF COMPILER:

"winepress" opens winepress compiler "winepress2 grapename juicename" compilers with parameters

DOCUMENTATION:

misc.: every line must end with an enter press tabs are ignored $ as the first character in a line denotes a comment "head" and "body": every program must include the following line: ENTRY
	everything before it is the head. everything after is the body.
Functions:
	defining a function:
		In head of file:
		[datatype (any c++ data type, or "string")]F_FunctionName [datatype]param1 [datatype]param2 ...
			code
			TOSS returnvalue
		ENDDEF
		
		for example:
		[float]F_add [float]num1 [float]num2
			[float]num1+num2 -> total
			TOSS total
		ENDDEF
	calling a function:
		In body:
		F_functionName param1 param2 ...
		(note that the parameters must be variables, not literals)
		for example:
		F_add one two
	built-in functions:
		F_RAND
			returns a random number from 0 to 255
		F_RAND_char
			returns a random letter
		F_PRINT message
			prints message to the console
		F_NL
			prints a line break
		F_BEEP
			produces hard drive beep
		F_GET_string
			prints "::", gets user input, and returns value as string.
		F_GET_float
			prints "::", gets user input, and returns value as float
		F_PAUSE
			waits for user to press enter
		F_INT_TO_CHAR int
			returns a character with assci value of int
		F_CHAR_TO_INT char
			returns ascii value of char
logic:
	use one per line with no spaces
	multiply
		*
	divide
		/
	add
		+
	subtract
		-
	and
		&
	or
		|
	not
		!
	greater than
		>
	less than
		<
	equal to
		=
flow:
	if/else if/else:
		IF booleanVarible
			code
		ENDIF
		ELSEIF booleanVarible
			code
		ENDELSEIF
		ELSE
			code
		ENDELSE
	while:
		WHILE booleanVariable
			code
		ENDWHILE
	timer:
		WAIT intVariableSeconds
variables:
	declaring a varible:
		[datatype]valueOrExpression -> name
		
		examples:
		[int]5 -> five
		[int]3+3 -> six
	changing a varible:
		valueOrExpression -> name
		
		example:
		4 -> five
	declaring an array:
		[datatype]{index0 index1 index2 ...} -> name
		
		example:
		[int]{1 2 3 4 5} -> oneToFive
	calling an array:
		name{index}
		
		example:
		oneToFive{1}
	strings:
		the value for a string must be between quotes.
		the symbol @ is the esape character
		@_ is a space
		@A is @
			
		example:
		[string]"strings@_and@_@A's" -> derp

example programs can be found in /projects each folder contains a .grape which is the uncompiled version, and a .juice which is the compiled version.

quick example

[int]F_foo [int]number
	number+1 -> out
	TOSS out
ENDDEF
$comment
ENTRY
[int]F_GET_float -> picked
[int]F_foo picked -> thing
F_PRINT thing
F_NL
F_PAUSE