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:tilda.grammar.TypeManager.java

License:Apache License

public boolean rolloverArgumentType(ParserRuleContext ctx, String ExpresionType, boolean merge) {
    TypeWrapper w = _ArgumentTypes.isEmpty() == true ? null : _ArgumentTypes.pop();
    if (w == null) {
        _LastError = "Closing a " + ExpresionType + " without having a Type manager active!!!!";
        return false;
    } else if (w._Type == null) {
        _LastError = "Closing a " + ExpresionType + " without having a Type gathered!!!!";
        return false;
    } else if (merge == false) {
        return handleType(w._Type, ctx);
    } else {// w  w w .  j av  a2  s  .  c o m
        TypeWrapper w2 = _ArgumentTypes.isEmpty() == true ? null : _ArgumentTypes.pop();
        if (w2 == null) {
            _LastError = "Merging a " + ExpresionType + " without having a LHS Type manager active!!!!";
            return false;
        } else if (w2._Type == null) {
            _LastError = "Merging a " + ExpresionType + " without having a LHS Type gathered!!!!";
            return false;
        } else {
            if (w2.compareType(w._Type, ctx.getText()) == false) {
                _LastError = w2.getLastError();
                return false;
            }
        }
    }
    return true;
}