Ejemplo n.º 1
0
 private static boolean doesNotDefineAttributes(final String keyword) {
   SymbolProto p = DescriptionFactory.getProto(keyword, null);
   if (p == null) {
     return true;
   }
   int kind = p.getKind();
   return !STATEMENTS_WITH_ATTRIBUTES.contains(kind);
 }
Ejemplo n.º 2
0
  private static void convertFacets(
      final Statement stm,
      final String keyword,
      final ISyntacticElement elt,
      final Set<Diagnostic> errors) {
    SymbolProto p = DescriptionFactory.getProto(keyword, null);
    for (Facet f : EGaml.getFacetsOf(stm)) {
      String fname = EGaml.getKey.caseFacet(f);

      // We change the "<-" and "->" symbols into full names
      if (fname.equals("<-")) {
        fname = keyword.equals(LET) || keyword.equals(SET) ? VALUE : INIT;
      } else if (fname.equals("->")) {
        fname = FUNCTION;
      }

      // We compute (and convert) the expression attached to the facet
      boolean label = p == null ? false : p.isLabel(fname);
      IExpressionDescription fexpr = convExpr(f, label, errors);
      addFacet(elt, fname, fexpr, errors);
    }

    // We add the "default" (or omissible) facet to the syntactic element
    String def = stm.getFirstFacet();
    if (def != null) {
      if (def.endsWith(":")) {
        def = def.substring(0, def.length() - 1);
      }
    } else {
      def = DescriptionFactory.getOmissibleFacetForSymbol(keyword);
    }
    if (def != null && !def.isEmpty() && !elt.hasFacet(def)) {
      IExpressionDescription ed = findExpr(stm, errors);
      if (ed != null) {
        elt.setFacet(def, ed);
      }
    }
  }
Ejemplo n.º 3
0
 @Override
 public SymbolProto getMeta() {
   return DescriptionFactory.getProto(keyword, getModelDescription());
 }