use of net.morimekta.providence.model.TypedefType in project providence by morimekta.
the class ThriftProgramParser method parseTypedef.
private void parseTypedef(ThriftTokenizer tokenizer, String comment, List<Declaration> declarations, Set<String> includedPrograms) throws IOException {
String type = parseType(tokenizer, tokenizer.expect("typename"), includedPrograms);
Token id = tokenizer.expectIdentifier("typedef identifier");
String name = id.asString();
if (!allowedNameIdentifier(name)) {
throw tokenizer.failure(id, "Typedef with reserved name: " + name);
}
TypedefType typedef = TypedefType.builder().setDocumentation(comment).setType(type).setName(name).build();
declarations.add(Declaration.withDeclTypedef(typedef));
}
Aggregations