// Path: engine/src/main/java/com/impossibl/stencil/engine/parsing/ParamOutputBlockMode.java
// public enum ParamOutputBlockMode {
//   Replace,
//   Before,
//   After
// }


import java.util.List;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode;
import com.impossibl.stencil.engine.parsing.ParamOutputBlockMode;
import com.impossibl.stencil.engine.parsing.StencilParser;
import com.impossibl.stencil.engine.parsing.StencilParser.BlockDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.BooleanLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.CallableSignatureContext;
import com.impossibl.stencil.engine.parsing.StencilParser.FloatingLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.FunctionDefinitionContext;
import com.impossibl.stencil.engine.parsing.StencilParser.IntegerLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.LValueRefContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MacroDefinitionContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MemberIndexSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MemberSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MethodCallSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.NamedOutputBlockContext;
import com.impossibl.stencil.engine.parsing.StencilParser.NamedValueContext;
import com.impossibl.stencil.engine.parsing.StencilParser.ParamOutputBlockModeContext;
import com.impossibl.stencil.engine.parsing.StencilParser.ParameterDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.SafeMemberSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.SimpleNameContext;
import com.impossibl.stencil.engine.parsing.StencilParser.StringLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.UnnamedOutputBlockContext;
import com.impossibl.stencil.engine.parsing.StencilParser.VariableDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.VariableRefContext;
    String text = ctx.getText();
    return text.substring(1, text.length()-1);
  }

  public static String value(SimpleNameContext ctx) {
    if(ctx.stringLit != null)
      return value(ctx.stringLit);
    if(ctx.id != null)
      return value(ctx.id);
    return null;
  }

  public static String value(ParserRuleContext ctx) {
    if(ctx == null)
      return null;
    return ctx.getText();
  }

  public static String value(TerminalNode node) {
    if(node == null)
      return null;
    return node.getText();
  }
  
  public static String value(Token token) {
    if(token == null)
      return null;
    return token.getText();
  }
  
// Path: engine/src/main/java/com/impossibl/stencil/engine/parsing/ParamOutputBlockMode.java
// public enum ParamOutputBlockMode {
//   Replace,
//   Before,
//   After
// }


// Path: engine/src/main/java/com/impossibl/stencil/engine/internal/Contexts.java
import java.util.List;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode;
import com.impossibl.stencil.engine.parsing.ParamOutputBlockMode;
import com.impossibl.stencil.engine.parsing.StencilParser;
import com.impossibl.stencil.engine.parsing.StencilParser.BlockDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.BooleanLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.CallableSignatureContext;
import com.impossibl.stencil.engine.parsing.StencilParser.FloatingLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.FunctionDefinitionContext;
import com.impossibl.stencil.engine.parsing.StencilParser.IntegerLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.LValueRefContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MacroDefinitionContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MemberIndexSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MemberSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.MethodCallSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.NamedOutputBlockContext;
import com.impossibl.stencil.engine.parsing.StencilParser.NamedValueContext;
import com.impossibl.stencil.engine.parsing.StencilParser.ParamOutputBlockModeContext;
import com.impossibl.stencil.engine.parsing.StencilParser.ParameterDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.SafeMemberSelectorContext;
import com.impossibl.stencil.engine.parsing.StencilParser.SimpleNameContext;
import com.impossibl.stencil.engine.parsing.StencilParser.StringLiteralContext;
import com.impossibl.stencil.engine.parsing.StencilParser.UnnamedOutputBlockContext;
import com.impossibl.stencil.engine.parsing.StencilParser.VariableDeclContext;
import com.impossibl.stencil.engine.parsing.StencilParser.VariableRefContext;

    String text = ctx.getText();
    return text.substring(1, text.length()-1);
  }

  public static String value(SimpleNameContext ctx) {
    if(ctx.stringLit != null)
      return value(ctx.stringLit);
    if(ctx.id != null)
      return value(ctx.id);
    return null;
  }

  public static String value(ParserRuleContext ctx) {
    if(ctx == null)
      return null;
    return ctx.getText();
  }

  public static String value(TerminalNode node) {
    if(node == null)
      return null;
    return node.getText();
  }
  
  public static String value(Token token) {
    if(token == null)
      return null;
    return token.getText();
  }
  
  public static ParamOutputBlockMode value(ParamOutputBlockModeContext ctx) {