197 questions
0 votes
0 answers
36 views
how to represent full Unicode range in regexp in JFlex?
Is it possible in the current version of JFlex (1.9.1) to represent a range of full Unicode values in a regular expression ? Something like this: UnicodeIdentifier = [a-zA-Z_\u007F-\u10FFFF] [a-zA-Z0-...
0 votes
0 answers
35 views
I don't understand this "(first %% is missing)" error
I'm having a problem with this jflex file. I derived it from some work I did on another language, itself derived from a lexer from a compilation course. package Analyse; import java_cup.runtime.*; ...
0 votes
1 answer
41 views
JFlex recognition conflict
I'm developing a lexical analyzer and parser using JFlex and CUP. I’m running into a conflict in my lexer, and I’m having trouble understanding why it’s happening. Here’s my lexer: import java_cup....
0 votes
1 answer
52 views
Syntax fragment (include or import) in YACC
Is it possible to include/import yacc fragment files from different files to a main YACC? Just to exemplify what I'm looking for, I would like to create 3 syntax parsers for 3 different files, but ...
0 votes
1 answer
120 views
JFlex RE matching lookahead and precedence
For XPath parsing, I need to distinguish the token type of "name" in the cases where it is followed by "::" (possibly after whitespace), followed by "(" (possibly after ...
0 votes
1 answer
38 views
How to set a package name for generated classes when using cup.gradle.cup-gradle-plugin?
The cup arg: -destdir does not work. With or without this option, the generated source files (parser and symbols) always in the top folder (build/generated-src/cup). For example as below, the expected ...
-1 votes
1 answer
55 views
How can I use JFlex if i´m cloning a project from github [closed]
i'm currently working on a Lexer in Java, i'm using jflex to do this, when my partner runs the code it works, he pushed it into a repo in github. I cloned it and when trying to run it, it says it ...
1 vote
2 answers
580 views
JetBrains Language Support Plugin
I am trying to implement language support plugin for a basic language. I am following jetbrains's tutorial for simple language support (.properties file support basically) and on the side I have rust ...
-1 votes
1 answer
479 views
JFLEX regular expressions for string starts with
I'm new with this jflex and regular expressions I read a lot even though I know I faced the solution in the manual but really I can't understand these regular expressions. I want simple read a text ...
0 votes
0 answers
100 views
Unexpected character JFLEX
Hello i was watching a tutorial on youtube. It was the start of tutorial but when i tried to wrote the code and run this flex.l file. The output show unexpected character [a-z] {printf("Single ...
-1 votes
1 answer
349 views
Regular expression for email in flex
I am trying to wirte a regular expression for emails in JFlex. So far I tried with this L=[a-zA-Z_]+ D=[0-9]+ email=[^(.+)@(\S+)$] %{ public String lexeme; %} %% {L}({L}|{D})* {lexeme=yytext();...
0 votes
1 answer
99 views
Jflex ambiguity
I have these two rules from a jflex code: Bool = true Ident = [:letter:][:letterdigit:]* if I try for example to analyse the word "trueStat", it gets recognnized as an Ident expression and ...
0 votes
0 answers
49 views
Why does my $1 operation not work with Java Bison?
When I have an abstract syntax tree in the Java Bison (.y) file with this: string_op: SYMBOL_PLUS { $$ = $1; System.out.println("this should print + here: " + $$);} | SYMBOL_DOUBLEEQ | ...
3 votes
0 answers
94 views
JFlex complaining about caret character
I'm trying to produce a simple standalone scanner with the use of JFlex. What I want to do now is to simply recognize the beginning of a line with the use of the caret (^) symbol. From the Semantics ...
0 votes
1 answer
191 views
Java Bison and Jflex error for redeclared/undeclared variables
I am making a compiler with Jflex and Bison. Jflex does the lexical analysis. Bison does the parsing. The lexical analysis (in a .l file) is perfect. Tokenizes the input, and passes the input to the ....