473,503 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ignore cstylecomment issues

from pyparsing import Word, printables,ZeroOrMore,cStyleComment
expr = ZeroOrMore(Word(printables))
expr.ignore(cStyleComment)
for line in expr.parseString('#include <iostream>\n\nint
main()\n{/*interesintg\ncomment*/\nstd::cout << "hello world";\n}'):
print line

outputs

#include
<iostream>
int
main()
{/*interesintg
comment*/
std::cout
<<
"hello
world";
}

if i put a space between { and /* then it works properly

any help plz

Oct 19 '06 #1
0 804

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

Similar topics

6
1714
by: Rob Meade | last post by:
Lo all, I was just running through some code I was writing for a site and when it came to the 'exact phrase' search type I wasn't sure whether that should run through and ignore the words in the...
1
34497
by: Thomas Bartkus | last post by:
The meaning of REPLACE INTO is clear to me. IF the new record presents new key values, then it is inserted as a new record. IF the new record has key values that match a pre-existing record, then...
10
2173
by: john | last post by:
I want the page to completely ignore all mouse clicks. I can create the onmouseclick event and return false, but that only disables certain types of things. I can still, for example, click in a...
6
2407
by: johkar | last post by:
I am in the process of editing the below code I found online, I have a from multi-select list and a to multi-select list. Before rewriting the to list, I want to sort it but ignore the "F - " and...
23
4068
by: FrancisC | last post by:
#include <stdio.h> int file_copy( char *oldname, char *newname ); int main() { char source, destination; printf("\nEnter source file: ");
4
2039
by: Jackson Miller | last post by:
I notice that postgres does not support IGNORE. I am currently migrating an app from a MySQL datastore to Postgres, and I would really like to use IGNORE. I am curious if there is a...
6
2716
by: sandy | last post by:
I seem to ALWAYS need to use cin.ignore in my programs (console apps using Dev C++ for a University course). The problem is that if I don't ignore ENOUGH characters then it's like not having the...
8
14123
by: kingjng | last post by:
Hi, I am working on a Widget that gets embedded into an existing page as a div in the body...Now I want to ensure that the my widget looks and behaves exactly the same on all web sites. But I...
1
3117
by: mandanarchi | last post by:
Set myHTTP = CreateObject("msxml2.xmlhttp") Set myDom = CreateObject("MSXML2.DOMDocument") myDom.async = False myDom.Load (myxml) myHTTP.Open "POST", "https://link-removed.aspx",...
0
7264
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,...
0
7316
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...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
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...
0
5562
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,...
1
4992
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...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
371
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...

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.