User Tools

Site Tools


Sidebar

<menu col=1,align=center>

<item>Documentation||[[lara:documentation]]|{{:lara:img:dictionary.png?25}}</item>
<item>Downloads||[[lara:downloads]]| {{:lara:img:projects.png?25}}</item>
<item>Tutorials||[[lara:tutorial]]|{{:lara:img:books.png?25}}</item>
<item>Other uses of LARA||[[lara:other]]|{{:lara:img:globe.png?25}}</item>
<item>About Us||[[https://sites.google.com/site/specsfeup/]]| {{:lara:img:specslogo.png?25}}</item>
<item>Projects||[[lara:usage]]| {{:lara:img:math.png?25}}</item>

</menu>

/* They are empty */ /* <item>FAQ||faq|</item> */ /* <item>Dev. Team||team| </item> */ /* <item>About LARA||about|</item> */

lara:docs:larac

larac

As explained in the specification and in the basics, LARA is partially agnostic to the target language. The association of aspects with a target language is done by the LARA compiler, i.e. larac, which converts LARA aspects into an aspect intermediate representation (Aspect-IR) based on a provided target language specification. larac is responsible not only for making common verification, such as existence of called aspects and the target select of an apply, but also for validating the aspects according to the language specification, e.g. pointcut validation (does the join points exist and if they can select a specific join point) and action validation (does the join point has a given action and are the arguments valid).

After compilation, any weaving environments that accepts an Aspect-IR can use the generated file to interpret the aspects and apply actions in the target code. Two examples of interpreters that accept an Aspect-IR as input are: BlueWeaver and larai. Both of these examples are generics interpreters that can interpret the Aspect-IR but require specific weaving engines to make changes in the target code.

Command Line

larac is an executable jar file (download here) that always expects a *.lara* file as the first input argument and has a set of optional arguments:

usage: java -jar larac.jar <larafile> [options]
 -a,--aspectir         Show Aspect-IR in the console
 -b,--verbose <arg>    Change the message level from 0(none) to 3(all). Default: 3
 -d,--debug            Enter debug mode, i.e., reply all the possible information
 -h,--help             Shows this message
 -i,--include <arg>    Include a list of folders containing lara aspect files. Separate paths with ';'
 -l,--language <arg>   Change the concerning programming language. Default: C
 -o,--output <arg>     Change Output directory of resulting files. Default: .\
 -r,--resource <arg>   Include a list of resources that reference lara aspect files. Separate paths with ';'
 -s,--stream <arg>     Change the output stream. Default: java.lang.System.out
 -v,--version          Shows the version of the LARA language and the Front-End
 -x,--xmlspec <arg>    Change language specification directory. Default: .\

The following table provides a further explanation of the larac options.

Short Option Long option Argument Description
-a –aspectir - Shows the resulting Aspect-IR in the console
-b –verbose <0-3> Change the message level (default: 3):
0: none
1: errors
2: errors and warnings
3: errors, warnings and logs
-d –debug - Execute in debug mode. This mode displays all information of the compilation to the log stream. Useful for reporting bugs to the larac developer
-h –help - List the available larac options
-i –include <dir+> Include a list of folders that contain lara aspect files. Multiple directories can be listed by separating their path with ';'
-l –language <C/Java/…> Change the concerning programming language (default: C). This option is deprecated and currently ignored by the compiler, as larac now only deals with the language specification.
-o –output <dir> Change Output directory of resulting files. Default: .\
-r –resource <resource+> Include a list of resources that reference lara aspect files. This option is important when working with lara aspects that are part, and thus resources of a Java program (e.g. when working with native aspects of MANET or Kadabra). Separate paths with ';'
-s –stream <file> Change the output stream to a file, instead of using the java default output stream assigned in java.lang.System.out.
-v –version - Shows the version of the LARA language and the compiler
-x –xmlspec <dir> Define the directory in which the language specification is stored (default: .\). The directory must contains the three files of the language specification (see more in Language Specification)
lara/docs/larac.txt · Last modified: 2019/09/22 15:47 (external edit)