At work we use a Business Rules language that was original designed for 'business' people to program but now has fallen on use, the programmers. The IDE/Eclipse plugin isn't what a we would call an 'IDE', but now that a Eclipse plugin has been added in the latest release of the standalone IDE we want to create a Eclipse Editor plugin with syntax coloring, checking etc.
I've been looking at Xtext tutorials but just can't seem to get a grasp on the concept of the grammarlanguage and was hopping if I provided some examples of the Business language someone could provide a grammarexample and some explanation and to what it was doing.
Examples:
varString is a string initially "Dog"; //String - 'a' can be interchanged with 'an'
varInteger is a integer initially 0; //Integer - 'a' can be interchanged with 'an'
varObject is some MyObject initially MyObject.newInstance( "Foo" ); //Object Creation
while ( varInteger < varObject.size() ) do {
varTemp = methodCall( parm1,
parm2,
parm3, );
varTemp1 = methodCallWithCast( parm1,
parm2,
parm3, ) as a MyObject; //'a' can be interchanged with 'an'
}
if ( varObject.size() > 0 ) then {
}
if ( varObject is not null and
varObject.size() < 0 ) then {
}
Note that the styling (spaces after/before the brackets, parameters on seperate lines) I'm hopping to be able to checking as this is the coding standard the we adhear to, and to throw an error if it is not followed
Thanks!