Class UnitGrammar

java.lang.Object
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T>
com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor<Unit>
com.walkfares.odsl.conversion.UnitGrammar
All Implemented Interfaces:
com.walkfares.odsl.conversion.grammar.UnitsVisitor<Unit>, org.antlr.v4.runtime.tree.ParseTreeVisitor<Unit>

public class UnitGrammar
extends com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor<Unit>
  • Constructor Summary

    Constructors 
    Constructor Description
    UnitGrammar()  
    UnitGrammar​(OpenDSLContext context)  
  • Method Summary

    Modifier and Type Method Description
    Unit parse​(String text)  
    UnitGrammar setContext​(OpenDSLContext context)  
    Unit visitNumber​(com.walkfares.odsl.conversion.grammar.UnitsParser.NumberContext ctx)
    Visit a parse tree produced by UnitsParser.number().
    Unit visitNumberValue​(com.walkfares.odsl.conversion.grammar.UnitsParser.NumberValueContext ctx)
    Visit a parse tree produced by UnitsParser.numberValue().
    Unit visitUnit​(com.walkfares.odsl.conversion.grammar.UnitsParser.UnitContext ctx)
    Visit a parse tree produced by UnitsParser.unit().

    Methods inherited from class com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor

    visitCode

    Methods inherited from class org.antlr.v4.runtime.tree.AbstractParseTreeVisitor

    visit, visitChildren, visitErrorNode, visitTerminal

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.antlr.v4.runtime.tree.ParseTreeVisitor

    visit, visitChildren, visitErrorNode, visitTerminal
  • Constructor Details

  • Method Details

    • setContext

      public UnitGrammar setContext​(OpenDSLContext context)
    • parse

      public Unit parse​(String text)
    • visitNumber

      public Unit visitNumber​(com.walkfares.odsl.conversion.grammar.UnitsParser.NumberContext ctx)
      Description copied from class: com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor
      Visit a parse tree produced by UnitsParser.number().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitNumber in interface com.walkfares.odsl.conversion.grammar.UnitsVisitor<Unit>
      Overrides:
      visitNumber in class com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor<Unit>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitNumberValue

      public Unit visitNumberValue​(com.walkfares.odsl.conversion.grammar.UnitsParser.NumberValueContext ctx)
      Description copied from class: com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor
      Visit a parse tree produced by UnitsParser.numberValue().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitNumberValue in interface com.walkfares.odsl.conversion.grammar.UnitsVisitor<Unit>
      Overrides:
      visitNumberValue in class com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor<Unit>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitUnit

      public Unit visitUnit​(com.walkfares.odsl.conversion.grammar.UnitsParser.UnitContext ctx)
      Description copied from class: com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor
      Visit a parse tree produced by UnitsParser.unit().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitUnit in interface com.walkfares.odsl.conversion.grammar.UnitsVisitor<Unit>
      Overrides:
      visitUnit in class com.walkfares.odsl.conversion.grammar.UnitsBaseVisitor<Unit>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result