Example usage for org.antlr.v4.runtime ParserRuleContext getText

List of usage examples for org.antlr.v4.runtime ParserRuleContext getText

Introduction

In this page you can find the example usage for org.antlr.v4.runtime ParserRuleContext getText.

Prototype

@Override
public String getText() 

Source Link

Document

Return the combined text of all child nodes.

Usage

From source file:org.elasticsearch.painless.Metadata.java

License:Apache License

/**
 * Retrieves ExternalMetadata from the externalMetadata map.
 * @param source The ANTLR node for this metadata.
 * @return The retrieved ExternalMetadata.
 *//*from   www .  j a  v  a 2 s.  c  om*/
ExternalMetadata getExternalMetadata(final ParserRuleContext source) {
    final ExternalMetadata sourceemd = externalMetadata.get(source);

    if (sourceemd == null) {
        throw new IllegalStateException(error(source) + "External metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }

    return sourceemd;
}

From source file:org.elasticsearch.painless.Metadata.java

License:Apache License

/**
 * Retrieves ExtNodeMetadata from the extNodeMetadata map.
 * @param source The ANTLR node for this metadata.
 * @return The retrieved ExtNodeMetadata.
 *//* ww  w  .  java2 s . co m*/
ExtNodeMetadata getExtNodeMetadata(final ParserRuleContext source) {
    final ExtNodeMetadata sourceemd = extNodeMetadata.get(source);

    if (sourceemd == null) {
        throw new IllegalStateException(error(source) + "External metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }

    return sourceemd;
}

From source file:org.elasticsearch.plan.a.Adapter.java

License:Apache License

StatementMetadata getStatementMetadata(final ParserRuleContext source) {
    final StatementMetadata sourcesmd = statementMetadata.get(source);

    if (sourcesmd == null) {
        throw new IllegalStateException(error(source) + "Statement metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }/*from  w ww .  java2s  . c o  m*/

    return sourcesmd;
}

From source file:org.elasticsearch.plan.a.Adapter.java

License:Apache License

ExpressionMetadata getExpressionMetadata(final ParserRuleContext source) {
    final ExpressionMetadata sourceemd = expressionMetadata.get(source);

    if (sourceemd == null) {
        throw new IllegalStateException(error(source) + "Expression metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }//from w ww.  j a  v a2s. c  o m

    return sourceemd;
}

From source file:org.elasticsearch.plan.a.Adapter.java

License:Apache License

ExternalMetadata getExternalMetadata(final ParserRuleContext source) {
    final ExternalMetadata sourceemd = externalMetadata.get(source);

    if (sourceemd == null) {
        throw new IllegalStateException(error(source) + "External metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }/*from w  ww  .j  a v  a2  s .  co  m*/

    return sourceemd;
}

From source file:org.elasticsearch.plan.a.Adapter.java

License:Apache License

ExtNodeMetadata getExtNodeMetadata(final ParserRuleContext source) {
    final ExtNodeMetadata sourceemd = extNodeMetadata.get(source);

    if (sourceemd == null) {
        throw new IllegalStateException(error(source) + "External metadata does not exist at"
                + " the parse node with text [" + source.getText() + "].");
    }/*from   ww w. j  a  v  a2  s  .  c  o  m*/

    return sourceemd;
}

From source file:org.hibernate.sqm.parser.hql.internal.HqlParseTreePrinter.java

License:Apache License

@Override
public void enterEveryRule(@NotNull ParserRuleContext ctx) {
    final String ruleName = parser.getRuleNames()[ctx.getRuleIndex()];

    if (!ruleName.endsWith("Keyword")) {
        HQL_LOGGER.debugf("%s %s (%s) [`%s`]", enterRulePadding(), ctx.getClass().getSimpleName(), ruleName,
                ctx.getText());
    }/*from   ww w  .  j  a  v  a2s  .  c  o m*/
    super.enterEveryRule(ctx);
}

From source file:org.hibernate.sqm.parser.hql.internal.HqlParseTreePrinter.java

License:Apache License

@Override
public void exitEveryRule(@NotNull ParserRuleContext ctx) {
    super.exitEveryRule(ctx);

    final String ruleName = parser.getRuleNames()[ctx.getRuleIndex()];

    if (!ruleName.endsWith("Keyword")) {
        HQL_LOGGER.debugf("%s %s (%s) [`%s`]", exitRulePadding(), ctx.getClass().getSimpleName(),
                parser.getRuleNames()[ctx.getRuleIndex()], ctx.getText());
    }/*from  w w w  . j a va2  s  . c  om*/
}

From source file:org.kie.dmn.feel.lang.ast.BooleanNode.java

License:Apache License

public BooleanNode(ParserRuleContext ctx) {
    super(ctx);
    value = Boolean.valueOf(ctx.getText());
}

From source file:org.kie.dmn.feel.lang.ast.NumberNode.java

License:Apache License

public NumberNode(ParserRuleContext ctx) {
    super(ctx);
    value = EvalHelper.getBigDecimalOrNull(ctx.getText());
}