User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:04_production:08_function

Function

It is possible to declare a function that can represent a production element. The function receive implicitly the current producer object and run its declared production rule. The first argument of the function must be of the same type of the implicitly given producer. The method must return void.

Example

import de.grogra.rgg.model.RGGProducer;
module A {
	void doStuff(RGGProducer prod, int aVar, float anotherVar){
		prod ==> F(aVar) F(anotherVar) ; // any production statement 
	}
}
 
void alsoProd(RGGProducer prod){
	prod ==> F Box;
}
 
public void run() [
 a:A ==> a.doStuff(1,2); // this will replace A by F(1) F(2)
 
 Node ==> alsoProd F F;  // this will replace Node by F Box F F
]
01_user_documentation/07_rgg_xl/02_xl/04_production/08_function.txt · Last modified: 2025/10/22 17:29 by gaetan