parsing

Tool for program statistics

Is there a tool which is able to parse my source code (fortran, C or C++) and return statistics such as the number of loops, the average loop size, the number of functions, the number of function calls, the number, size and type of arrays, variables, etc ? Something similar to this which does not run easily on my architecture ...

how to create a parser for search queries

for example i'd need to create something like google search query parser to parse such expressions as: flying hiking or swiming -"walking in boots " author:hamish author:reid or house in new york priced over $500000 with a swimming pool how would i even go about start building something like it? any good resources? c# re...

Is There A Fast GetToken Routine For Delphi?

In my program, I process millions of strings that have a special character, e.g. "|" to separate tokens within each string. I have a function to return the n'th token, and this is it: function GetTok(const Line: string; const Delim: string; const TokenNum: Byte): string; { LK Feb 12, 2007 - This function has been optimized as best as po...

htmlParser Help

UPDATE: Hi Pascal, Thanks for the quick reply, This is almost what I wanted. The newlink is different for each tag, can you please help me to do that. Thanks Micheal All i need to do is iterate over all the link tags that appear in the input String, grab their value, and replace with a different link with out disturbing the link text ...

Python: How to replace dashes in filenames?

The question is related to the answer about renaming files recursively. The code, changed to replace dashes, does not work with cases such as: ./Beginners Tools/Hello's -Trojans-/bif43243 ./Linux/Nux Col - 1 Works (TEX & Pdf) - T'eouhsoe & More (33323 - 34432) ./Git/peepcode-git-mov/c6_branch_merge.mov ./haskell/OS 2007 - T aoue ./B Si...

recommendation for html parser library in as3 for flex project

Hi, Can somebody recommend a simple html parsing library, written in as3 for a flex project? Thanks, Nava ...

Selective merge of two or more data files

Dear Overflowns: I have an executable whose input is contained in an ASCII file with format: $ GENERAL INPUTS $ PARAM1 = 123.456 PARAM2=456,789,101112 PARAM3(1)=123,456,789 PARAM4 = 1234,5678,91011E2 PARAM5(1,2)='STRING','STRING2' $ NEW INSTANCE NEW(1)=.TRUE. PAR1=123 [More data here] $ NEW INSTANCE NEW(2)=.TRUE. [etcetera] In ...

Flash parsing XML without loading an external file (as2)

Hi, In my flash, the socket server returns some xml data that I need to parse, but it seems that the only way to start the XML object is with the XML.Load() which loads an external file, but my XML file is already loaded into a variable trace("raw: "+msg); msgArea.htmlText += "update remote player loc"; var playerLocXMLOb = new XML(...

Parsing Text Files and Sorting in Ruby

I am somewhat new to Ruby and I would appreciate some direction in solving the problem which I will now describe. I would like to write a Ruby program which can parse 3 separate text files each of which contain different delimiters and then sort them according to certain criteria. Can someone please point me in the right direction? ...

Visual studio (2008) integration - intellisense and colourizer

Hi Guys, So I'm now about to look at getting visual studio integration working for our port of the Less ruby library: www.dotlesscss.com. This is basically a CSS preprocessor that extends on the CSS language to give you variables, mixins, nested rules etc... What we want is to have our .Less file type take advantage of VS's intelligen...

How can I make XML::Simple's output more human friendly?

I am using the XML::Simple module to parse an XML file. When I run the following script then I do not get data in human readable form and so it is difficult to see the output of the parsed XML file. Code: #!usr/bin/perl -w use XML::Simple; my $ref = XMLin('SampleXML.xml'); use Data::Dumper; print Dumper($ref); ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site has meta tags like this (each page different): <meta name="clan_name" content="Dark Mage" /> So what I'm doing is using cURL to place th...

Find value in Json by javascript

Hi All, I cant find one way to get this value ("comment") into json using javascript. var myJSONObject = { "topicos": [{ "comment": { "commentable_type": "Topico", "updated_at": "2009-06-21T18:30:31Z", "body": "Claro, Fernando! Eu acho isso um extremo desrespeito. Com os celulares de ho...

PHP Excel Reader : get strikeout / strikethrough value

I am looking for way to parse the strikeout / strikethrough value of cells in an Excel sheet, using if possible a PHP script. The cells that are strikeout or not contain simple text values (no formula or anything). I have try using http://code.google.com/p/php-excel-reader/ and a few others scripts. But I have not found any PHP script t...

Scripting .NET objects

Hi I have a simple .NET application which runs as Windows Service. Say it has one Class MyClass { Run(Destination d) Walk(Destination d) Wash(Dishes d) } I want to create a console application where I would type simple human readable commands like run left walk right Pretty much like you do in windows console. I wonder wh...

I want a small regex that accepts a var(int,enum1,enum2) in C#

Dear All, I have never dealt with regular expressions before, and I am facing a problem here. The user has to input a text like Var1(0,enum1,enum2), and I have to check the syntax on the following manner:- 1- make sure Var1 name matches the list of variables I have.. Just a string comparison 2- make sure the parameters are input in se...

How to retrive non standard node from RSS feed in Ruby

Hi I use this parser for my project: http://simple-rss.rubyforge.org/ It works nice but I have nodes like this: <dc:creator>viroos</dc:creator> I have no idea how to get nodes like this. ...

Converting an XML-document to a dictionary

I do not need to edit any XML-file or anything, this is only for reading and parsing. I want to be able to handle the XML-document as a dictionary, like: username = doc["username"];, but I can't find out how to "convert" the document. I've also encountered the problem with duplicate key-names, but that could be easlily avoided by appen...

Search for a string in a text file and parse that line (Linux, C)

This is "how to parse a config file" question. Basically i have a text file (/etc/myconfig) that has all kind of settings. I need to read that file and search for the string: wants_return=yes once I locate that string I need to parse it and return only whatever it is after the equal sign. I've tried using a combinations of fgets and s...

How can I read and parse a URL's XML or JSON content with C++?

I can easily do this with JQuery or PHP but I have a project for my Intro to C++ class and I thought it'll be pretty cool if I could mix C++ with some APIs like twitter, google, yahoo etc. Could you tell me if there is a class ( I know OOP ) I can use to read an external XML or JSON file. The program has to run on windows and linux so I...