473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Seekign BNF (lex / yacc) for serialized files

I have been looking around for an editor which edit serialised files
(as created with the PHP function serialize()), but can't find one, so
I have decided to code my own.

I can either hand code the parsing, or use Lex/Yacc (actually Flex/
Bison). Rather than reinvent the wheel, I thought that I would ask of
anyone knows of any BNF (Backus-Naur form) files for expressing
serialized data (actual Lex/Yacc files would be even better, of
course).

No biggy, as it should be reasonably trivial to hack together, but my
natural laziness inclines me away from reinventing the wheel, so I
thought that I would ask first.

Mar 15 '07 #1
2 2407
Just for fun, I did it with Lex & Yacc, then I handcrafted a parser.

Because the length field are given, I actually found this to be one of
the few cases where I am happier with a handcrafted solution than Lex/
Yacc.

Mar 19 '07 #2
On 15 Mar, 03:47, "Baron Samedi" <Papa.Legba.... @gmail.comwrote :
I have been looking around for an editor which edit serialised files
(as created with thePHPfunction serialize()), but can't find one, so
I have decided to code my own.

I can either hand code the parsing, or use Lex/Yacc (actually Flex/
Bison). Rather than reinvent the wheel, I thought that I would ask of
anyone knows of anyBNF (Backus-Naur form) files for expressing
serialized data (actual Lex/Yacc files would be even better, of
course).

No biggy, as it should be reasonably trivial to hack together, but my
natural laziness inclines me away from reinventing the wheel, so I
thought that I would ask first.
www.intralogic.eu

there is a php grammar soon available to download for Visual BNF
parser generator

Apr 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
10726
by: Moonlit | last post by:
Hi, I am searching for the best lex and yacc combination (or something similar) that can be used in combination with C++ and that can contain C++ code. I have the regular flex/bison port working but then I, of course, can't use C++ constructs in the actions. I have tried spirit although I could make a simple command line parser (after...
1
2011
by: Alvaro Puente | last post by:
Hi all! Firstly, is there a newsgroup for YACC-LEX? My application dies when I'm parsing a really long string and, although I increase YYMAXDEPTH value I see no changes. Anyone can help me with this matter or tell where to ask? Thanks/Alvaro
1
4257
by: cylin | last post by:
Dear all, I am a newbie using lex and yacc. I really don't know what's wrong with my code, because the output is not what I want. My yacc rules don't match, and yylex seems just read only one line of the text file. Please help...thx.
3
2036
by: Gvs | last post by:
Hi, i'm trying to implement a few things in lex and yacc though i'm having trouble. What i want to do is be able to parse a term and an expression. in EBNF my term is defined as: term ::= factor { '*' | '\' } . factor is defined as: factor ::= ident | '(' expression ')' | number . expression is defined as: expression ::= '+' | '-'...
2
11805
by: RAyRAy | last post by:
Is there a Lex and Yacc for C# or basically .NET CLR? I hope there is. I would rather use .NET rather than C. If there is a Lex and Yacc can you let me know of the class and namespace it is under. I did a search and couldn't find any.
6
15461
by: Volker Hetzer | last post by:
Hi! We are finding ourselves in a situation where we have to parse several more or less free format text files. In the past, on linux, we had flex and bison for generating very fast parsers for these files. Is there any equivalent in the visual studio world? Lots of Greetings! Volker --
2
7493
by: max.giacometti | last post by:
Hi everybody! I am using lex and yacc to write a vhdl to systemc converter. Lex simply reads the input file and yacc implements grammar and translation. I'd like to be able to make yacc able to command lex to stop reading the current file and starting reading another file, when the inclusion syntax is reached.
1
2020
by: Robert | last post by:
If the goal is to take a 1-dimensional package of text and produce a tree data structure that is easy to understand and manipulate, and then write C/C++ code that works with that tree - does lex/yacc suit that purpose - i.e. kind of like a tree-manufacturing C library? Or is it for producing a compiler/interpreter the internals of which a new...
1
5173
by: mh | last post by:
I'm porting a C lex/yacc based project, and would like to redo it in python. What's the best option for a python lex/yacc-like? I've googled a few things, but wanted to see the current concensus. Many TIA! Mark --
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.