Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:49:26+00:00 2026-05-22T14:49:26+00:00

I’m trying to write a native Node.js parser using Flex/Bison. There are three parts

  • 0

I’m trying to write a native Node.js parser using Flex/Bison. There are three parts to the addon: the lexer, the parser, and the node/v8 interface. The lexer and the parser were working well in the beginning (I used g++ to compile the lexer/parser and included the necessary lexer functions like this: http://tldp.org/HOWTO/Lex-YACC-HOWTO-5.html). When I added the node/v8 section into the mix, I ended up getting a missing symbol error for a function defined in the lexer code.

Here’s an overview of the file structure:

File A: Lexer file, automatically generated by flex from the lexer rules I wrote.

File B: The parser file, includes the extern "C" { [lexer functions] } and 
        a function called parse(std::string). parse() calls some yy_functions, 
        which are defined in the lexer, and returns a c++ data structure 
        representing the parsed data.

File C: This is the node/v8 part. There is a header file with the prototype for 
        B's parse() function. When JS calls a certain function, the data is 
        converted to a c++ string and passed to the parse() function in File B.

When I run a simple test to parse a JS string, I get an error saying

node: symbol lookup error: /home/monty/projects/flex_bison/GetObj_Request_Parser/build/default/GetObjParser.node: undefined symbol: yy_scan_string

Note: I’m using node-waf to build the addon and I’ve renamed the files generated by flex and bison from [FILE].c to [FILE].cc so that the build script picks them up.

If you would like to see some code, you can find it all here: https://github.com/IDX-io/GetObj_Request_Parser (look in the src/buildstuffs dir).

File A = src/buildstuffs/lex.yy.c[c]
File B = src/buildstuffs/geto.tab.c[c]
File C = src/buildstuffs/GetObjParser.cc
Test = test.js

Thanks!

[EDIT] Instead of using two different compilers and messing around with the node-waf build script (my solution), one could probably use flex++ and bison++ to generate C++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:49:27+00:00Added an answer on May 22, 2026 at 2:49 pm

    renaming the files to .cc will generally cause default make rules to build using c++ instead of c. That could mean that the linkage is wrong on the functions in the lex.yy.c file. I think you need to figure out another way to make the node build system recognize your .c files and build them properly with as c, not c++

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.