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

  • SEARCH
  • Home
  • 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 4068722
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:24:37+00:00 2026-05-20T16:24:37+00:00

I’m working on an intelligent agent model that requires, as input, a list of

  • 0

I’m working on an intelligent agent model that requires, as input, a list of events. The events come from the output of another model and are in a (large) text file. The text file is a list of all events (including unnecessary events that I don’t care about), so I’ve written a scanner using flex that can find the useful bits. The framework for the intelligent agent model is already written in C++.

Each event is timestamped and contains a large amount of information about the event. The format of the input file is constant, so I really have no need to check the syntax. I don’t know if Bison will actually offer me any advantages, because the grammar is actually pretty simple. There’s no real variation.

I just need a way to place each event (and all the information from that event) onto a stack. The intelligent agent acts on each event chronologically, so I need the program to scan the entire input file, then place each event onto a stack in reverse order (the first event in the input file should be the last event pushed onto the stack). That will allow the intelligent agent to pop the events off the stack and deal with them one at a time.

My thought is that bison won’t help me much, because the grammar is simply a matter of listing all of the tokens sequentially. It’d basically look like this:

eventlist: /* nothing */
| eventlist event EOL
;

event: token1 token2 token3 ... tokenN-1 tokenN

Here’s a small snippet of the input file, so you can see what I mean:

Scenario Event Time: DAY 1 00:00:00
[DATA FUSION EVENT] New Track Formed
Summary
Actual Target: RF HQ
Fusion Center Location: CVN Enterprise_0
Fusion Center Name: DEFAULT FUSION
Perceived Target
Perceived Identification: Unknown
Perceived Classification: Unknown
Operating Medium: Land

I have a few questions:

1) How do I integrate the scanner generated by flex with the larger program that already exists?
2) Will bison offer any advantages or am I best off simply writing my own program to put all the tokens on a data structure and put them on the stack?
2a) If bison is better, then that solves question 1, but then how do I call bison from within my program and then have bison return a pointer to the stack so the program can use it?

//Edited: I’ve figured out how to call flex from an external C++ program. I have been unable, so far, to create a bison program that will do what I want, though (namely, return a pointer to a stack of events).

  • 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-20T16:24:38+00:00Added an answer on May 20, 2026 at 4:24 pm

    If your grammar is that simple then using a parser seems overkill. Just process each line and scan the tokens into a collection.

    Why do you think you need a parser?

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
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
I have some data like this: 1 2 3 4 5 9 2 6

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.