Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Antlr4 boolean operations

Antlr4 boolean operations

Scheduled Pinned Locked Moved Visual Studio
helptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MarcoReiner
    wrote on last edited by
    #1

    Hey, i have some problems with my Antlr Project. I want to type in some Boolean expressions like (2and1)or0 (true and false) or true ..or similar stuff. And as a result i would like to have a single True or False With the bool expressions True/False the code works fine. So here is my problem:

    public override bool VisitInt(Combined2Parser.IntContext context)
    {
    return bool.Parse(context.INT().GetText());
    }

    i want to convert the Integer numbers of my string into boolean expressions and i dont understand why this is not working with this method. I have to say i am very new with Antlr and it would also be a great help if someone can tell me how to write the grammar for Antlr4.Till now i did some Tutorials with some mathematical operands, but i dont really know how to transfrom this Knowledge on Logial operands.

    S 1 Reply Last reply
    0
    • M MarcoReiner

      Hey, i have some problems with my Antlr Project. I want to type in some Boolean expressions like (2and1)or0 (true and false) or true ..or similar stuff. And as a result i would like to have a single True or False With the bool expressions True/False the code works fine. So here is my problem:

      public override bool VisitInt(Combined2Parser.IntContext context)
      {
      return bool.Parse(context.INT().GetText());
      }

      i want to convert the Integer numbers of my string into boolean expressions and i dont understand why this is not working with this method. I have to say i am very new with Antlr and it would also be a great help if someone can tell me how to write the grammar for Antlr4.Till now i did some Tutorials with some mathematical operands, but i dont really know how to transfrom this Knowledge on Logial operands.

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      As I haven't heard of that library before I could only suggest that you have a look at the following link http://www.antlr.org/support.html[^] they state in there that they use StackOverflow as a medium for support based questions.

      Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups