lexical-analysis Questions
2
Solved
I am having a big problem to write a regexp that will trim all the whitespace in my input.
I have tried \s+ and [ \t\t\r]+ but that don't work.
I need this because I am writing a scanner using fl...
Roque asked 9/11, 2012 at 23:3
5
Solved
JsLex is a Javascript lexer I've written in Python. It does a good job for a day's work (or so), but I'm sure there are cases it gets wrong. In particular, it doesn't understand anything about semi...
Strickman asked 4/4, 2011 at 2:9
1
Solved
I'm working on seperating lexing and parsing stages of a parser. After some tests, I realized error messages are less helpful when I'm using some tokens other than Parsec's Char tokens.
Here are s...
Oneiric asked 28/8, 2012 at 20:50
5
Solved
I am writing lexer rules for a custom description language using pyLR1 which shall include time literals like for example:
10h30m # meaning 10 hours + 30 minutes
5m30s # meaning 5 minutes + 30 sec...
Bukharin asked 2/7, 2012 at 11:49
5
Solved
What is the lexical and syntactic analysis during the process of compiling. Does the preprocessing happens after lexical and syntactic analysis ?
Chestnut asked 23/6, 2012 at 19:18
3
In flex, I want to return multiple tokens for one match of a regular expression. Is there a way to do this?
Chorea asked 22/2, 2009 at 9:11
1
Solved
The title sums it up. Presumably anything that can be done with source-code-generating parser-generators (which essentially hard-code the grammar-to-be-parsed into the program) can be done with a c...
Nonconformist asked 8/1, 2012 at 18:59
1
Solved
I want to ignore whitespaces and new lines with my grammar so they are missing in the PEG.js output. Also, a literal within brackets should be returned in a new array.
Grammar
start
= 'a'? sep+ ...
Shayne asked 24/11, 2011 at 12:37
2
Solved
I have the following code and it gives an error" "hello.l",line 31: premature EOF" when I run the following command
flex hello.l
%{
#include <stdlib.h>
#include "y.tab.h"
%}
%%
("hi"|...
Outwash asked 22/11, 2011 at 12:41
3
Solved
i would like to use the code generated by lex in another code that i have , but all the examples that i have seen is embedding the main function inside the lex file not the opposite.
is it possibl...
Extravert asked 4/11, 2011 at 17:57
3
Solved
Yesterday a colleague showed me the following postgres query. We were both surprised that it worked:
SELECT* FROM mytable;
Since I recently coded a parser for another language, I am trying to un...
Coadjutress asked 6/8, 2011 at 16:16
1
Solved
My apologies if the title of this thread is a little confusing. What I'm asking about is how does Flex (the lexical analyzer) handle issues of precedence?
For example, let's say I have two tokens...
Earache asked 18/7, 2011 at 17:11
4
Solved
I'm looking for a decent lexical scanner generator for C#/.NET -- something that supports Unicode character categories, and generates somewhat readable & efficient code. Anyone know of one?
...
Volatilize asked 5/10, 2008 at 16:4
3
Solved
I've already written a generator that does the trick, but I'd like to know the best possible way to implement the off-side rule.
Shortly: Off-side rule means in this context that indentation is ge...
Stanhope asked 24/10, 2008 at 6:59
7
I'm working on a project where I need to analyze a page of text and collections of pages of text to determine dominant words. I'd like to know if there is a library (prefer c# or java) that will ha...
Bipartite asked 20/10, 2008 at 22:38
6
Solved
Besides not closing a comment /*..., what constitutes a lexical error in C?
Daysidayspring asked 4/4, 2011 at 6:39
1
Solved
There are several questions on SO about parsing structured text in Ruby, but none of them apply to my case.
I'm the author of the Ruby Whois library. The library includes several parsers to parse ...
Yellowbird asked 16/2, 2011 at 22:43
2
Solved
I'm trying to match a control character in the form \^c where c is any valid character for control characters. I have this regular expression, but it's not currently working: \\[^][@-z]
I think th...
Roughneck asked 4/2, 2011 at 1:46
1
Solved
Hey folks, thanks for reading
I am currently attempting to do a Google-style calculator. You input a string, it determines if it can be calculated and returns the result.
I began slowly with the ...
Poaceous asked 18/1, 2011 at 16:38
1
Solved
I'm newbie to flex. I'm trying to write a simple re-entrant lexer/scanner with flex. The lexer definition goes below. I get stuck with compilation errors as shown below (yyg issue):
reentrant.l:
...
Eugenol asked 14/4, 2010 at 4:59
3
Solved
During the Compiler Design Lab hours, I'm using JLex as the Lexical Analyzer Generator, which produces a Java program from a lexical specification.
I'd like to know if there are other tools which ...
Intricate asked 29/8, 2010 at 10:25
4
Solved
I am parsing sentences. I want to know the relevant content of each sentence, defined loosely as "semi-unique words" in relation to the rest of the corpus. Something similar to Amazon's "statistica...
Impromptu asked 13/8, 2010 at 20:19
1
Solved
Is there any way to return multiple tokens in OCamlLex?
I'm trying to write a lexer and parser for an indentation based language, and I would like my lexer to return multiple DEDENT tokens when i...
Booted asked 9/8, 2010 at 6:42
2
Solved
I currently have a working, simple language implemented in Java using ANTLR. What I want to do is embed it in plain text, in a similar fashion to PHP.
For example:
Lorem ipsum dolor sit amet
<...
Anomalistic asked 9/5, 2010 at 17:46
4
Solved
I am embarking on some learning and I want to write my own syntax highlighting for files in C++.
Can anyone give me ideas on how to go about doing this?
To me it seems that when a file is opened...
Runny asked 17/4, 2010 at 0:56
© 2022 - 2024 — McMap. All rights reserved.