コード例 #1
0
 private static void convElse(
     final S_If stm, final ISyntacticElement elt, final Set<Diagnostic> errors) {
   EObject elseBlock = stm.getElse();
   if (elseBlock != null) {
     ISyntacticElement elseElt =
         SyntacticFactory.create(ELSE, elseBlock, EGaml.hasChildren(elseBlock));
     if (elseBlock instanceof Statement) {
       elseElt.addChild(convStatement(elt, (Statement) elseBlock, errors));
     } else {
       convStatements(elseElt, EGaml.getStatementsOf((Block) elseBlock), errors);
     }
     elt.addChild(elseElt);
   }
 }
コード例 #2
0
 static final void convStatements(
     final ISyntacticElement elt,
     final List<? extends Statement> ss,
     final Set<Diagnostic> errors) {
   for (final Statement stm : ss) {
     ISyntacticElement child = convStatement(elt, stm, errors);
     if (child != null) {
       elt.addChild(child);
     }
   }
 }
コード例 #3
0
 private static void convertArgs(
     final ActionArguments args, final ISyntacticElement elt, final Set<Diagnostic> errors) {
   if (args != null) {
     for (ArgumentDefinition def : EGaml.getArgsOf(args)) {
       ISyntacticElement arg = SyntacticFactory.create(ARG, def, false);
       addFacet(arg, NAME, convertToLabel(null, def.getName()), errors);
       EObject type = def.getType();
       addFacet(arg, TYPE, convExpr(type, errors), errors);
       // addFacet(arg, TYPE, convertToConstantString(null, EGaml.getKey.caseTypeRef(type)),
       // errors);
       // convertType(arg, type, errors);
       Expression e = def.getDefault();
       if (e != null) {
         addFacet(arg, DEFAULT, convExpr(e, errors), errors);
       }
       elt.addChild(arg);
     }
   }
 }