|
A simple Program & program structure
|
Program structure in vera :
Vera is more like C++ with some concurrency constructs added on it. Lets start with a hello world example in Vera :
// Hello world example
#include
program hello {
printf("hello world \n");
}
To compile :
$> vcs -ntb hello.vr
And to run
$> ./simv
It will pring "hello world" on the console.
If we look at the above example following things can be extracted :
- Vera allows C/C++ type comments (starting with //)
- In every program we need to include the file vera_defines.vrh . Vera have its own preprocessor. The lines starting with # and ` are preprocessed by the vera preprocessor and they are replaced with the actual test.
- Vera program execution starts from the keyword program like in C it starts from main().
- All statements terminate with semicolon exactly like C++.
- Blocking is done by curly braces (start bracket { and end bracket is }. Single statement does not need to enclosed in brackets.
|
|
This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start
|
Next >> Data Types
|
Posted By : pl - Sept. 13, 2009, 5:56 p.m.
example program should have a file associated with "#include" in the example above. typo: "pring" should be "print".