Exemplo n.º 1
0
        private static FlatBuffersParser GetParser(string fbs)
        {
            AntlrInputStream  input       = new AntlrInputStream(fbs);
            FlatBuffersLexer  lexer       = new FlatBuffersLexer(input);
            CommonTokenStream tokenStream = new CommonTokenStream(lexer);
            FlatBuffersParser parser      = new FlatBuffersParser(tokenStream);

            parser.AddErrorListener(new CustomErrorListener());

            return(parser);
        }
Exemplo n.º 2
0
        private static BaseSchemaMember ParseSyntax(string fbsSchema, string inputHash)
        {
            AntlrInputStream  input       = new AntlrInputStream(fbsSchema);
            FlatBuffersLexer  lexer       = new FlatBuffersLexer(input);
            CommonTokenStream tokenStream = new CommonTokenStream(lexer);
            FlatBuffersParser parser      = new FlatBuffersParser(tokenStream);

            parser.AddErrorListener(new CustomErrorListener());

            SchemaVisitor    visitor  = new SchemaVisitor(inputHash);
            BaseSchemaMember rootNode = visitor.Visit(parser.schema());

            return(rootNode);
        }