vrsperanza/CPY

Partager

data picture

To form the executable merely stop develop on the supply folder
To assemble cpy files use the created executable targeting the fundamental file of the dear project:
cpy predominant.cpy -flags

CPY is a (Pre)Compiler of .cpy files, those are generally C++ withought redundancy.
	Curly brackets are implied from identation
	Semicolons are implied from line breaks (traces must be marked to continue, no longer to demolish)
	Headers are interpreted from the sources and involves
	Can return extra than one values from capabilities
	While peaceful being statically typed (and supreme as fleet as C++, for it is ultimate a pre-compiler)
		variable forms can even be implied from equity or manually specified.
	Sequenced style declarations have additionally been generalised to capabilities:
		"int a, b" works interior feature declarations
Simply stop the compiler followed by your supply folder and this can also form the executable

In any of the given examples, « cpy mainFile.cpy » will form a working executable

Functions:

Generates the total valuable headers and compiles resulting project. In case you consist of a header « #consist of « somecode.h » » of a « somecode.cpy », the header will most likely be generated (besides because the cpp file)

Default compilation is optimized in makefile style, simplest recompiling modified files, rising overall compilation prance
With the usage of a flag (-ex) generates a c++ project folder, makefile included, willing for sharing

Implies semicolons from endlines,
Implies {} the usage of identation,

Can point out variable forms from project:

a = 10
b = a
//Announces a and b as integers

Frequently you fabricate no longer need to list a brand new instance of a circuitously visible variable, this the identified tag used to be created

void Rectangle::set_values (int w, h)
	identified width = w
	identified height = h
//This might presumably perhaps exclaim the compiler width and height are interior the Rectangle namespace, thus no longer implying variable declaration

Can return extra than one values from capabilities:

operations(int a, b)
	sum = a + b
	subtract = a - b
	multiply = a * b
	divide = a / b
	return sum, subtract, multiply, divide
	
predominant()
	sum, _, mult = operations(20, 10)
	! sum mult

//Produces the output:
30 10

//_ variables point out ignore this return cost
//The closing variables can even be no longer licensed if no longer valuable

Implies feature argument forms basically based on earlier:

int somefunction(string a, b)
	code...
//Announces a and b as strings

Can point out parenthesis on if, switch, for and whereas:

	if x > zero
		...
	else if x < zero
		...
	for int i = zero; i < one hundred; i++
		...
	whereas x--
		...
	switch x
		case 1:
			...
			demolish
		...

Can point out ">>" and "<<" on cin, cout and cerr

	cin a b
	cout a b endl
	cerr a b endl

Four new print capabilities:

	! arg1 arg2 arg3
	//! prints a brand new line, with each and each argument separated by areas
	
	!! arg1 arg2 arg3
	//!! prints each and each argument separated by areas
	
	? "advised" variable variable "advised" variable 
	//? Reads input given interior variables the usage of cin and prints given strings the usage of cout
	
	?? arg1 arg2 arg3
	//?? is meant for debugging, prints a brand new debug line within the layout:
	//arg1 = ContentOfArg1 | arg2 = ContentOfArg2 | arg3 = ContentOfArg3

Two new loop capabilities:

	for i n
		...
	//Iterates i from zero (or assigned cost) to n-1, 1 at a time
	rof i n
		...
	//Iterates i from n-1 to zero (or assigned cost), 1 at a time

Fresh precompilation tag: #raw "file"
Entails file's mutter straight in code before exporting, usefull whereas it is most likely you'll presumably perhaps also simplest ship one file as an replacement of a project - supposed for templates at competitive coding.

Would possibly presumably well also merely additionally be compiled alongside routine cpp files, so hybrid projects are that it is most likely you'll presumably perhaps also instruct of
CPY can additionally assemble pure cpp projects, this can also robotically link files and assemble them intelligently

Handiest edits clones of the supply files in a separate folder

USAGE: cpy SourceCode Flags
Flags:
        -h: Reveals this aid online page
        -b: Utilize line breaks on itermediate code
        -s: Nonetheless compilation, simplest prints errors
        -ex: Exports project to a itemizing containing simplest c++ supply and a Makefile
        -r: Mechanically runs compiled code
        -nc: Would no longer assemble resulting code
        -o aim: Specifies aim executable title, when no longer specified aim = a
        -OtherFlags: Redirects flag to underlying compiler (g++)

Read More

(Visité 2 fois, 1 aujourd'hui)

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *