473,656 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ignore cstylecomment issues

from pyparsing import Word, printables,Zero OrMore,cStyleCo mment
expr = ZeroOrMore(Word (printables))
expr.ignore(cSt yleComment)
for line in expr.parseStrin g('#include <iostream>\n\ni nt
main()\n{/*interesintg\nc omment*/\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 809

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

Similar topics

6
1724
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 ignore list or not. I ran off and checked your ASPFAQ webby and I notice that Aaron still strips them out, I was just wondering if this is the usual way to deal with that search type, or whether there were good reasons when creating it to still...
1
34611
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 the key violation is ignored and the new record *replaces* the pre-existing record. But what about INSERT IGNORE? Is this a synonym for REPLACE INTO - i.e. it does precisely the same thing?
10
2203
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 text box and then type something or change the selection in a dropdown list. I tried returning false in the onmousedown event, but that didn't do the trick. I'd rather not have to disabled all the controls on the page. Any ideas? Thanks in advance,...
6
2420
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 the "R - ". Ideas??? F - A200000 Some Text Here R - H205200 Some Other Text John function move(fbox, tbox) {
23
4093
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
2047
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 recommended work-araound. Thanks, -Jackson
6
2726
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 cin.ignore. If I ignore too many that's just as bad. There has got to be some way to just say 'if there is anything in the input stream or buffer get rid of it' so I can start fresh so to speak. What is it? (It has just GOT to exist...)
8
14142
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 am running into issues where customers have setup global CSS rules for all sorts of elements like table {border:1px solid} a {text-decoration:underline} etc.
1
3131
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", False myHTTP.Send (myDom.xml) I use this code to send xml orders to one of our suppliers (there's more to it, but this is the relevant part) One of them isn't working today, I emailed their tech guy and he tried telling me that I'm sending...
0
8380
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8598
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.