|
|
|
|
|
Re: Cannot generate artifacts with Xtext 2.9.2 from DSL made with 2.5.4 [message #1726435 is a reply to message #1726434] |
Sun, 13 March 2016 14:18 |
|
the following worked for me
(1) create a new xtext project
(2) use this slightly different grammar
grammar org.xtext.example.mydsl4.MyDsl with org.eclipse.xtext.common.Terminals
hidden(WS, SL_COMMENT)
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate myDsl "http://www.xtext.org/example/mydsl4/MyDsl"
// Base elements allowed in the .wf file
Model:
(
(workflow=AvWFWorkflow)?
& (libs+=AvWFLib)*
);
// -----------------
// Language elements
AvWFLib:
"lib" name=ID ("extends" baseLib=[AvWFLib])? "{"
(
( stdparamdefs+=AvWFStdParamDef )*
& ( actiondefs+=AvWFActionDef )*
& ( allowdefs+=AvWFAllowDef )*
& ( validatordefs+=AvWFValidatorDef )*
& ( "script" scriptFileName=STRING ";" )?
)
"}";
AvWFStdParamDef:
(doc=ML_COMMENT)?
"stdparam" name=ID ":" type=Type ";";
AvWFActionDef:
(doc=ML_COMMENT)?
"action" name=ID actionContent=STRING ";";
AvWFAllowDef:
(doc=ML_COMMENT)?
"allow" key=STRING ";";
AvWFValidatorDef:
(doc=ML_COMMENT)?
// TODO Doesn't work because "workflow" is a keyword and imports often contain it :-(
// See http://www.eclipse.org/forums/index.php/m/1015388/
// "validator" name=ID ":" clsName=[ jvmTypes::JvmType | QualifiedName ] ";";
// "validator" name=ID ":" clsName=[ jvmTypes::JvmParameterizedTypeReference | QualifiedName ] ";";
"validator" name=ID clsName=STRING ";";
// AvWFWorkflow stuff
AvWFWorkflow:
"workflow" name=ID "{"
(
( "lib" lib=[AvWFLib] ";" )?
& ( "i18n" (i18nBundles+=QualifiedName) (',' i18nBundles+=QualifiedName)* ";" )?
& ( "start" startState=[AvWFState] ";" )?
& ( "script" scriptFileName=STRING ";" )?
& ( defaultValidator=AvWFValidator )?
& ( states+=AvWFState )*
)
"}";
AvWFValidator:
"validator" validator=[AvWFValidatorDef] ";";
// AvWFState stuff
AvWFState:
"state" name=ID "id" id=INT (isViewable?="viewable")? (isImportable?="importable")? "{"
(
("resKey" resKey=ResKeyValue ";")?
//& (params+=AvWFParam)*
& (targets+=AvWFTarget)*
)
"}";
// Param stuff
AvWFParam:
AvWFStdParam | AvWFUserParam;
AvWFUserParam:
"param" name=ID "=" value=STRING ";";
AvWFStdParam:
"stdparam" param=[AvWFStdParamDef] ("=" value=AvWFParamValue)? ";";
AvWFParamValue:
IntValue | StringValue | StatePointerValue;
// Target stuff
AvWFTarget:
"target" state=[AvWFState] "{"
(
("action" action=AvWFActionType ";")?
& ("resKey" resKey=ResKeyValue ";")?
& ("availableIf" available=AvWFBooleanGroovyCall ";")?
& ("automaticIf" automatic=AvWFBooleanGroovyCall ";")?
& ("preExecScript" preExecScript=AvWFGroovyCall ";")?
& ("postExecScript" postExecScript=AvWFGroovyCall ";")?
& (validator=AvWFValidator)?
& (allowAll?="allowAll" ";")?
& (allows+=AvWFAllow)*
& (params+=AvWFParam)*
)
"}";
AvWFAllow:
"allow" allow=AvWFAllowType ";";
AvWFAllowType:
StringValue | AvWFAllowDef;
AvWFActionType:
val=StringValue | actionDef=[AvWFActionDef];
AvWFBooleanGroovyCall:
method=ID "(" (params=STRING)? ")";
AvWFGroovyCall:
method=ID "(" (params=STRING)? ")";
// Data types */
IntValue:
val=INT;
StringValue:
val=STRING;
StatePointerValue:
state=[AvWFState];
Type:
PrimitiveType /* | ComplexType*/;
/*
ComplexType:
"XXX";
*/
PrimitiveType:
IntType | StringType | BooleanType | StatePointerType;
StatePointerType:
{StatePointerType} "statepointer";
IntType:
{IntType} "int";
StringType:
{StringType} "string";
BooleanType:
{BooleanType} "boolean";
ResKeyValue:
resKey=QualifiedName;
QualifiedName:
ID ("." ID)*;
terminal INT returns ecore::EInt: ('0'..'9')+;
this workflow
module org.xtext.example.mydsl4.GenerateMyDsl
import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*
var rootPath = ".."
Workflow {
component = XtextGenerator {
configuration = {
project = StandardProjectConfig {
baseName = "org.xtext.example.mydsl4"
rootPath = rootPath
runtimeTest = {
enabled = true
}
eclipsePlugin = {
enabled = true
}
eclipsePluginTest = {
enabled = true
}
createEclipseMetaData = true
}
code = {
encoding = "UTF-8"
fileHeader = "/*\n * generated by Xtext \${version}\n */"
}
}
language = StandardLanguage {
name = "org.xtext.example.mydsl4.MyDsl"
fileExtensions = "mydsl4"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
parserGenerator = {
antlrParam = "-Xconversiontimeout"
antlrParam = "5000"
options = {
memoize = true
}
}
}
}
}
i dont have any memory setting for with workflow run config a use jdk8 64 bit.
(you may have a look at / play with the following memory settings as well)
-Xmx4G -XX:-UseGCOverheadLimit
(but please file a ticket anyway)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.03402 seconds