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 7041081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:59:42+00:00 2026-05-28T01:59:42+00:00

I have this line: 0, 6 -> W(1) L(#); or \# -> @shift_right R

  • 0

I have this line:

0, 6 -> W(1) L(#);

or

\# -> @shift_right R W(1) L

I have to parse this line with flex, and take every element from every part of the arrow and put it in a list. I know how to match simple things, but I don’t know how to match multiple things with the same rule. I’m not allowed to increase the limit for rules. I have a hint: parse the pieces, pieces will then combine, and I can use states, but I don’t know how to do that, and I can’t find examples on the net. Can someone help me?

So, here an example:

{

a -> W(b) #invert_loop;

b -> W(a) #invert_loop;

-> L(#)

}

When this section begins I have to create a structure for each line, where I put what is on the left of -> in a vector, those are some parameters, and the right side in a list, where each term is kinda another structure. For what is on the right side I wrote rules:

writex W([a-zA-Z0-9.#]) for W(anything).

So I need to parse these lines, so I can put the parameters and the structures int the big structure. Something like this(for the first line):

new bigStruc with param = a and list of struct = W(anything), #invert(it is a notation for a reference to another structure)

So what I need is to know how to parse these line so that I can create and create and fill these bigStruct, also using to rules for simple structure(i have all I need for these structures, but I don’t how to parse so that I can use these methods).

Sorry for my English and I hope this time I was more clear on what I want.

Last-minute editing: I have matched the whole line with a rule, and then work on it with strtok. There is a way to use previous rules to see what type of structure i have to create? I mean not to stay and put a lots of if, but to use writex W([a-zA-Z0-9.#]) to know that i have to create that kind of structure?

  • 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-28T01:59:43+00:00Added an answer on May 28, 2026 at 1:59 am

    Ok, lets see how this snippet works for you:

    // these are exclusive rules, so they do not overlap, for inclusive rules, use %s
    %x dataStructure
    %x addRules
    %%
    <dataStructure>-> { BEGIN addRules; }
    \{                { BEGIN dataStructure; }
    <addRules>;       { BEGIN dataStructure; }
    <dataStructure>\} { BEGIN INITIAL; }
    
    <dataStructure>[^,]+ { ECHO; } //this will output each comma separated token
    <dataStructure>. { } //ignore anything else
    <dataStructure>\n { } //ignore anything else
    <addRules>[^ ]+ { ECHO; } //this will output each space separated rule
    <addRules>. { } //ignore anything else
    <addRules>\n { } //ignore anything else
    %%
    

    I’m not entirely sure what it it you want. Edit your original post to include the contents of your comments, with examples, and please structure your English better. If you can’t explain what you want without contradicting yourself, I can’t help you.

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

Sidebar

Related Questions

I have this line in a javascript block in a page: res = foo('<%=
I have this line in a useful Bash script that I haven't managed to
I have this line of code for page load: if ($(input).is(':checked')) { and it
I have this line of JavaScript and the behavior I am seeing is that
I have this line in the declarations section: Private filePath As String And something
I have this line in my program : InputStream Resource_InputStream=this.getClass().getClassLoader().getResourceAsStream(Resource_Name); But how can I
I have this line below that shows a link to go the next page
Say I have this line of code in the view. <?php echo CHtml::activeTextField($model,'start_time'); ?>
At the beginning of a makefile I have this line : PATH := $(PATH):/other/dir
I'm using GDOME.pm and in my script I have this line: my $doc =

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.