use of org.metaborg.core.syntax.MultiLineCommentCharacters in project spoofax by metaborg.
the class SyntaxFacetFromESV method multiLineCommentCharacters.
private static Iterable<MultiLineCommentCharacters> multiLineCommentCharacters(IStrategoAppl document) {
final Collection<MultiLineCommentCharacters> multiLineCommentCharacters = Lists.newLinkedList();
final Iterable<IStrategoAppl> terms = ESVReader.collectTerms(document, "BlockCommentDef");
for (IStrategoAppl term : terms) {
final String prefix = ESVReader.termContents(term.getSubterm(0));
final String postfix = ESVReader.termContents(term.getSubterm(2));
multiLineCommentCharacters.add(new MultiLineCommentCharacters(prefix, postfix));
}
return multiLineCommentCharacters;
}
use of org.metaborg.core.syntax.MultiLineCommentCharacters in project spoofax by metaborg.
the class SyntaxFacetFromESV method create.
@Nullable
public static SyntaxFacet create(IStrategoAppl esv, FileObject location) throws FileSystemException {
final String parseTableLocation = parseTableLocation(esv);
final FileObject parseTable;
if (parseTableLocation == null) {
parseTable = null;
} else {
parseTable = location.resolveFile(parseTableLocation);
}
final FileObject completionParseTable = null;
final Iterable<String> startSymbols = startSymbols(esv);
final Iterable<String> singleLineCommentPrefixes = singleLineCommentPrefixes(esv);
final Iterable<MultiLineCommentCharacters> multiLineCommentCharacters = multiLineCommentCharacters(esv);
final Iterable<FenceCharacters> fenceCharacters = fenceCharacters(esv);
final SyntaxFacet syntaxFacet = new SyntaxFacet(parseTable, completionParseTable, startSymbols, singleLineCommentPrefixes, multiLineCommentCharacters, fenceCharacters);
return syntaxFacet;
}
Aggregations