BasicProgram stereotype

BasicProgram indicates that a program that does not accept realtime input from the user and is not specialized for a UI technology. This stereotype is the default when you use the Program classifier to write a custom type.

EGL package name

eglx.lang

Example use
In the following example, the main function declares variables, invokes a second function named calculate, and passes a list of three integers:
Program MyProgram type BasicProgram
   function main()
      MyGradeList INT[3]{80, 90, 100};
      MyAverage BIN(4,2);
      MyAverage = calculate(MyGradeList);
      SysLib.writeStdOut(MyAverage);
   end

   function calculate(myScore INT[]) returns (BIN (4,2))
      numberOfScores, i, mySum INT;
      numberOfScores = myScore.getSize();
      for (i from 1 to numberOfScores by 1)
         mySum = myScore[i] + mySum;
      end
         return (mySum/numberOfScores);
   end
end

The invoked function returns the average value, and the main function writes that value to the standard output.

Stereotype detail
Record BasicProgram type Annotation
{
   targets = [ElementKind.programPart],
   validationProxy = 
      // the following value goes on one line, but is on two for display
      "org.eclipse.edt.compiler.binding.annotationType.
       BasicProgramAnnotationTypeBinding",
   @Stereotype
}
   unloadOnExit boolean;
end
Stereotype fields
unloadOnExit
Takes a Boolean value that indicates whether the program, after running, is to be removed from memory.
Annotations for each member field
None.
Comments
Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript Not supported.