EMFContext¶
- 
public class 
EMFContextextends StandaloneContext¶ A Coco Context that is able to handle EMF Coco elements. This means that EMF elements can be directly loaded (see the new overrides for loadModule), and coco Node’s can be transformed back to the EMF equivalents.
Methods¶
fromNode¶
loadModule¶
- 
public final Node 
loadModule(ModuleDecl moduleData)¶ Loads the given module using the specified data as its contents.
Parameters: - moduleData – The EMF element for the given module.
 
Returns: The root Coco element. If loading fails this will be an invalid node in which case diagnostics will be reported to this Context’s DiagnosticConsumer.
loadModule¶
- 
public final Node 
loadModule(ModuleDecl moduleData, boolean log)¶ 
printModule¶
- 
public final String 
printModule(ModuleDecl moduleData)¶ Pretty prints the given module without loading it, using the specified data as its contents. This will result in a more human-readable file: for example ‘==’ will be used as opposed to ‘Eq.equals’.
Parameters: - moduleData – The EMF element for the given module.
 
Returns: The pretty printed version of the module.
printModule¶
- 
public final String 
printModule(ModuleDecl moduleData, String cocoFormatSpec)¶ Pretty prints the given module without loading it, using the specified data as its contents. This will result in a more human-readable file: for example ‘==’ will be used as opposed to ‘Eq.equals’.
Parameters: - moduleData – The EMF element for the given module.
 - cocoFormatSpec – A Coco format specification given as a JSON dictionary. For example, “{“ColumnLimit”: “120” }”.
 
Returns: The pretty printed version of the module.
toNode¶
toResource¶
- 
public final ModuleDecl 
toResource(Node node)¶ Exports a node representing a Coco module
Parameters: - node – The module node to export.