Search in sources :

Example 1 with AttributeDict

use of org.antlr.v4.tool.AttributeDict in project antlr4 by antlr.

the class ScopeParser method parse.

public static AttributeDict parse(ActionAST action, String s, char separator, Grammar g) {
    AttributeDict dict = new AttributeDict();
    List<Pair<String, Integer>> decls = splitDecls(s, separator);
    for (Pair<String, Integer> decl : decls) {
        if (decl.a.trim().length() > 0) {
            Attribute a = parseAttributeDef(action, decl, g);
            dict.add(a);
        }
    }
    return dict;
}
Also used : Attribute(org.antlr.v4.tool.Attribute) AttributeDict(org.antlr.v4.tool.AttributeDict) Pair(org.antlr.v4.runtime.misc.Pair)

Aggregations

Pair (org.antlr.v4.runtime.misc.Pair)1 Attribute (org.antlr.v4.tool.Attribute)1 AttributeDict (org.antlr.v4.tool.AttributeDict)1