New Languae (BRC)

Introduction:


I love to create languages, so I got to create a c + +
Call BRC. This language is not object-oriented, but is very quiet to program. It is similar to the language Bash linux, not finished yet, already has many more Cóias, and other details ... She is Brazilian, I stopped to think and decided to create a Brazilian language q because I have no reason to create another English ...
I'll provide it for testing, if someone in enteressar source just tell me ..
And any error, it is normal for now.
This language is Compiled and Interpreted, it does not depend on any other source language.
I would like to take a look and comment please ..
Excuse the language was based in the Portuguese language (Brazil)
still wanted you to verify another thing, the test files
that go along with. seundo download the exe are in English to be easy to understand.

Download:


Source: http://www.4shared.com/rar/i0WX89Fg/BRC_4.html
Exe: http://www.4shared.com/rar/gXnPZTne/Release_3.html ( .rar 4 files, brc.exe (console) and 3 files of test)

If you order two dlls, put these dll in the project folder: http://www.4shared.com/rar/KkVrQFFI/LibsGcc.html

In the second download files has three test, to test the
files is only arrastalos and drop on top of 'brc.exe' if you want
test 'brc.exe' No file is only executalo and write the desired commands ...

Tutorial:


1º) Functions and Arguments

You can access function within function, ex:

exibir exibir (10 * 2) * 2

Result:
40
40

That would be different from:

exibir exibir(10 * 2) * 2
Result:

20
40

The difference is that in the second case, the display of only the inside handle
arguments "10 * 2" and the first case as it has a space, it takes
arguments "(10 * 2) * 2".
In funçõens that takes no arguments, can be called without
parentheses, if any one variable with the same name, the function will not be
call, ex:

1
2
3
4
linha // jump 1 line
linha = 20
linha // understand the language that you called the variable
linha() // jump 1 line 


2º) Variables

Declare Variables:

1
2
3
4
5
6
7
8
9
10
a = 10
b = 20
a += 300
exibir a, b

a = "ola"
a += "hehe"
a *= 3
a += 150
exibir a


Result:
310
20
"olaheheolaheheolahehe150"

Matching variables:

1
2
3
4
5
6
7
8
a = 10
b &= a

a = 30
exibir b

b = 40
exibir a

Result:
30
40

(In this case when you use the command '& =' you equals the variable,
then 'a' is 'b' and 'b' is 'a')

3º) Pre-Defined Functions:

1
2
3
4
5
6
7
8
9
10
11
12
setar(var, valor) // would be the same as 'var = value'
igualar(var1, var2) // would be like 'var1 & var2 ='
exibir([valor, ...]) // show values in screen
saida(var) // Grab all that enter and play in the variable
linha([num]) // jump 'num' lines
sistema(texto) // call cmd
sair() // exit
se(condição, se, [senao]) // condition se (condition, if, else)
executar(caminho_texto) // open file
limpar() // clear screen
de (var : inicio..fim ) // for (var=0 : ini..end)
interno([texto, ...]) // Compile and Interprete intern code 

[color=Blue]obs: [ ] => Optional Argument , ... => Supports various arguments[/color]

4) Expression 'de' :

Using expression 'de':

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
de (teste : 0...4) {
  exibir teste
}

de (teste : 0..4) 
{
  exibir teste
}

de (teste : -5...-3) { exibir teste }

de (teste : 2..4) exibir teste

de (teste : 1...4)
  exibir teste


Result:
0, 1, 2, 3
0, 1, 2, 3, 4
-5, -4
2, 3, 4
1, 2, 3

Recalling that the term "beginning ... end" with 3 points excludes the last number
then only will the 'beginning' till 'end + 1' or 'end - 1' depending on the occasion ..
And with only two points, including the 'end' ...
Last edited on
Topic archived. No new replies allowed.