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. C / C++ / MFC
  4. Parsing with bison and flex

Parsing with bison and flex

Scheduled Pinned Locked Moved C / C++ / MFC
toolsjsonquestion
6 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.
  • A Offline
    A Offline
    andyg 101
    wrote on last edited by
    #1

    Hello I'm interested in coding my own parser for various files using bison and flex. Does anyone know of any good information/tutorials about these tools? Andy

    R 1 Reply Last reply
    0
    • A andyg 101

      Hello I'm interested in coding my own parser for various files using bison and flex. Does anyone know of any good information/tutorials about these tools? Andy

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      I learnt with "Lex & Yacc" by John Levine, Tony Mason & Doug Brown, by O'Reilly press. It's fairly comprehensive and makes a good reference book, but is simple enough to learn from. There are a couple of substantial examples to explain things (a SQL parser and a menu generation language). Hope this helps Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
      Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

      A 1 Reply Last reply
      0
      • R Ryan Binns

        I learnt with "Lex & Yacc" by John Levine, Tony Mason & Doug Brown, by O'Reilly press. It's fairly comprehensive and makes a good reference book, but is simple enough to learn from. There are a couple of substantial examples to explain things (a SQL parser and a menu generation language). Hope this helps Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
        Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

        A Offline
        A Offline
        andyg 101
        wrote on last edited by
        #3

        Ok my next question is where can I get a copy of these programs? Andy

        R 1 Reply Last reply
        0
        • A andyg 101

          Ok my next question is where can I get a copy of these programs? Andy

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          Bison: http://www.gnu.org/software/bison/bison.html[^] Flex (GNU lex): http://www.gnu.org/software/flex/flex.html[^] It's for linux, but compiles under Windows (I've done it) Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
          Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

          A 1 Reply Last reply
          0
          • R Ryan Binns

            Bison: http://www.gnu.org/software/bison/bison.html[^] Flex (GNU lex): http://www.gnu.org/software/flex/flex.html[^] It's for linux, but compiles under Windows (I've done it) Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
            Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

            A Offline
            A Offline
            andyg 101
            wrote on last edited by
            #5

            Thanks, my unix is a bit rusty do i need to get make and all that to compile it or can I do it under VisC++? :-) Andy

            R 1 Reply Last reply
            0
            • A andyg 101

              Thanks, my unix is a bit rusty do i need to get make and all that to compile it or can I do it under VisC++? :-) Andy

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #6

              VC++ compiles it just fine. If it throws up an error about missing "unistd.h", just create a blank file and put it in your include directory. It's not a necessary file, but it saves from messing with the source :). I can't remember if it asks for it or not. I think that the generated lex or bison C files include it, but it's not necessary and a blank dummy file works fine. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
              Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

              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