473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problems with dparser grammar

Hello, I am playing around a little bit with dparser, and I thought that
maybe someone on this list can help me out(There does not seem to be a
dparser list, atleast not an active one). I am total n00b to parsers so
this might be very easy. I want a parser that can parse both these lines
(What I am looking to construct is a parser of a _very_ limited subset
of objective-c).

[[self _rowsForAddingContentObject:content] retain]
NSArray *contentRowArray

This is what I have so far.

from dparser import Parser

def d_objcmsg(t):
'objcmsg: "\[" (objcmsg|var) msg "\]" '
def d_varDef(t):
'varDef: classname "\*" var'
def d_classname(t):
'classname: "[A-Z][A-Za-z_0-9]*"'
def d_var(t):
'var: "[a-z_][A-Za-z_0-9]*" '
def d_msg(t):
'msg: (msgWithArg|"[a-z_][A-Za-z_0-9]*")'
def d_msgWithArg(t):
'msgWithArg: "[a-z_][A-Za-z_0-9]*" ":" (var|objcmsg)'
Parser().parse("[[self _rowsForAddingContentObject:content]
retain]",print_debug_info=1)
Parser().parse("NSArray *contentRowArray",print_debug_info=1)

this makes the "[[self _rowsForAddingContentObject:content] retain]"
line pass, however I get a syntax error on the other one. Switching the
placing of d_obcmsg and d_varDef makes the other line pass, but then the
first fail with a syntax error. I want both of the lines to pass. Anyone
have any ideas?

Thanks in advance.
Joachim

Jul 18 '05 #1
0 989

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

Similar topics

2
by: Christopher Subich | last post by:
From the documentation, it looks like DParser-python will do what I need, but I'm having trouble getting it installed properly. I'm using a win32 environment, with official 2.4 Python binaries. ...
3
by: junky_fellow | last post by:
I got one link to the ANSI C Grammar http://www.lysator.liu.se/c/ANSI-C-grammar-y.html However, I don't know how to understand this grammar. I am not a Computer Science Guy. Can anybody please...
14
by: Magius | last post by:
Hello, I have a question about the correctness of the language grammar for the C# 2.0 specification. I am working with the grammar specified in the June 2005 ECMA-334 standard. Basically, a...
5
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.