I have an idea for a hobby project which performs some code analysis and manipulation. This project will require both the concrete and abstract syntax trees of a given source file. Additionally, bi-directional references between the two trees would be helpful. I would like to avoid the work of transcribing a grammar to construct my own l...
I'm using jquery DynaCloud with wordCount to create a dynamic tagcloud.
I have specific terms to include in the cloud (though the frequency is different for each user), and some of the terms are multiple word, or have special characters ("&", "'", " ", etc.) as part of the term.
I break the terms with specific html blocks:
<pre><span...
Is there library support for parsing command line arguments in Java?
Preferably in the APIs that are with the default JRE, and supporting UNIX-like arguments
Something along the lines of PERL's GetOpt?
...
I have the following code: DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile);
How can I get it to parse XML contained within a String instead of a file?
...
I have a C# WPF application that is suddenly throwing an exception on startup, and I cannot figure out why. The exception is a C++ HRException, and it occurs in MSCORLIB in CreateInstanceSlow(), which is called from CreateInstance(), which is called from BamlRecordReader.CreateInstanceFromType() in the System.Windows.Markup assembly. I m...
Using servlets I need to send request to predefined urls and the pages obtained must be parsed to determine the image tag and the keywords associated with the image and thus receive the links of the image or obtain the images.
...
I'm looking for a good explanation of the definitions of the FIRST, FOLLOW, and PREDICT sets of a RDP when given a grammar.
...
I use anchors in my URLs, allowing people to bookmark 'active pages' in a web application. I used anchors because they fit easily within the GWT history mechanism.
My existing implementation encodes navigation and data information into the anchor, separated by the '-' character. I.e. creating anchors like #location-location-key-value-k...
I have a simple XML with a CDATA section like:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<config>
<input>
<![CDATA[
line
another line
and another
]]>
</input>
...
</config>
And I have the current code for parsing the CDATA section using MSXML.
for (int i = 0, count = pChildNodes->Getlength(); i < count; ++i) {
...
On JSON.org the essential data structures that JSON represents are given as
A collection of name/value pairs, and
An ordered list of values.
I have not been able to find anywhere whether a second member having the same name as one already parsed into the current object should (a) throw an exception or (b) replace the existing membe...
I'm trying to build a bbcode parser, but I'm having quite some problems figuring out how to avoid matching too widely. For example I want to implement a [list] to conversion like this:
\[list\](.*)\[/list\]
would be replaced by this:
<ul>$1</ul>
This works fine, except if I have two lists where the regular expression matches the b...
Are there any best practices that I should follow while writing a parser?
...
I'm trying to write a string processing function in F#, which looks like this:
let rec Process html =
match html with
| '-' :: '-' :: '>' :: tail -> ("→" |> List.of_seq) @ Process tail
| head :: tail -> head :: Process tail
| [] -> []
My pattern matching expression against several elements is a bit ugly (the whole '-' :: ...
What's the best algorithm for evaluating a mathematical expression? I'd like to be able to optimize this a little in the sense that I may have one formula with various variables, which I may need to evaluate hundreds of times using different variables. So basically if I can initially parse the formula so that it is optimized in some way,...
Lets say you have a class SomeClass which has its own implementation of toString(), and also has the ability to parse a new instance of itself by reading that same string.
Which of these methods do you prefer, or find better to use?
You can either define it as another constructor:
public SomeClass(String serializedString);
or you can...
Hey all,
I have a string ($string for this example) and I want to do the following: Parse the string and convert all links within it to "actual links" (adding the open/close anchor tag) -- what is the best way to do this? I tried using preg_split() to create an array of the links contained in the string, with the idea of using str_repl...
i want to perform analysis on SQL code.
In this i would like to separate the blocks in SQL code.
for example, in the code below
for condition1 loop
stmt1;
for condition2 loop
stmt2;
end loop;
end loop;
i want to separate these two blocks and create a data structure which will contain outer loop block and will also have inner loop bloc...
I have a list of function calls stored in a database, and for some function calls, I care about what the arguments of the function call are. I am parsing C source code with my program (which is in C#). I'm trying to find the best way of getting the function calls with the arguments. I read the source code into a string prior to parsin...
My application reads an Excel file using VSTO and adds read data to a StringDictionary. It adds only data that is a number with few digits (1000 1000,2 1000,34 - comma is a delimiter in Russian standards).
What is better to check current string being appropriate number?
object data, string key; // data had read
try
{
Convert.ToDoubl...
i have variable $result that contains this
Country: USA City: NY Latitude: 32.2667 Longitude: 71.9167
How do I parse it so I can get the out put like this:
Country=USA&City=NY&Latitude=32.2667&Longitude=71.9167
...