Questions tagged [jflex]

JFlex — The Fast Scanner Generator for Java. JFlex is a flex-like lexer generator for Java.

JFlex is a lexical analyzer generator (also known as scanner generator) for Java, written in Java. It is also a rewrite of the very useful tool JLex which was developed by Elliot Berk at Princeton University. As Vern Paxson states for his C/C++ tool flex: They do not share any code though.

JFlex is designed to work together with the LALR parser generator CUP by Scott Hudson, and the Java modification of Berkeley Yacc BYacc/J by Bob Jamison. It can also be used together with other parser generators like ANTLR or as a standalone tool.

Related Links:

196 questions
1
vote
2 answers

java.lang.NoSuchMethodError: java_cup.runtime.lr_parser.getSymbolFactory()Ljava_cup/runtime/SymbolFactory

A project I just started working on uses JFlex, and when I try and compile the project using ant, I get the following error: java.lang.NoSuchMethodError: java_cup.runtime.lr_parser.getSymbolFactory()Ljava_cup/runtime/SymbolFactory What's causing…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
1
vote
1 answer

How to generate autocompletion via grammar structure?

I configured the grammar of a structured language and now want to code the autocompletion behaviour. Is there a way to generate that based on the grammar which is defined like this? RootObject ::= ROOT ( NameAttr | TitleAttr )* END private NameAttr…
dnltsk
  • 1,037
  • 1
  • 8
  • 9
1
vote
0 answers

How get Expressions using Java Cup for Java Interpreter

I am creating a Interpreter using jflex and cup, but i dont know how to implements a nested statements, if else loops etc. I want to know if i can get a expression inside a statement to analyze it si ::= SI LPAREN ID:id COMMA ENTERO:value…
1
vote
1 answer

How to install Jflex on Mac OS Sierra

I've spent the last 3 hours trying to follow the instructions on the http://jflex.de/installing.html page. So far I have tried: to move the jflex-1.6.1 file to the hidden usr/shared folder (which is not permitted) and moving the jflex-1.6.1 file to…
pseudogram
  • 301
  • 1
  • 2
  • 8
1
vote
0 answers

JFlex + BYACC/J: Syntax error

I am using JFlex + BYACC/J to parse a small language. Everything works but the error message for any syntax error (yyerror) is simply "Error: syntax error". Is there any (easy) way of generating more verbose error messages? The -v (verbose) flag…
User
  • 229
  • 3
  • 11
1
vote
1 answer

I cant generate CUP parser and JFlex scanner in cmd

i'm new in compiler . i've read that i can generate xxx.flex file in cmd by this code : java JFlex.Main xxx.flex but i got this error : Error: Could not find or load main class JFlex.Main and for generating yyy.cup , i typed : java…
Eng.sabbath
  • 111
  • 1
  • 1
  • 8
1
vote
1 answer

How to create a lambda symbol at jflex?

I'm doing a syntactic Analixer with jflex + javacup. At the .cup gramatic I have this part: SUBPPARAMLIST ::= lambda | "(" EXPLIST ")" Where lambda mean nothing (SUBPPARAMLIST can be empty) Well, I managed to create all my tokens correctly in my…
1
vote
1 answer

How does one change the path that Grammar-Kit's generated lexer Java file is generated into?

How do I change the path that Grammar-Kit's generated JFlex lexer Java file is generated into? I've asked on Grammar-Kit's issue tracker, but haven't received any response. I'm tired of of the lexer not being put into my generated files directory…
naki
  • 932
  • 6
  • 11
1
vote
0 answers

Parsing Elm case expression clashes with function call

I am developing an Intellij plugin for the Elm language using JFlex and Grammar Kit. I have minimal experience writing parsers. I can't parse case expressions because they clash with function calls. The BNF spec is as follows: expr ::= NUM |…
mikemay
  • 3,707
  • 6
  • 34
  • 35
1
vote
1 answer

using JFlex instead of Regex

I am new to JFlex. I have gathered that JFlex is a parser generator. However, I am still not clear about the following and need clarification around the same. How different this is from using regex for pattern identification and data segregation…
Nrj
  • 6,723
  • 7
  • 46
  • 58
1
vote
1 answer

Ignore java comments with JFlex

Hi I am trying to ignore java comments using JFlex but I can't manage to make it working, I always have an error in execution. I used these two lines: commentary = "//"[\r\n]*(\r|\n|\r\n) {commentary} {} I also tried different things…
Umut LeBg
  • 13
  • 4
1
vote
1 answer

jFlex methods (yypushStream,yypopStream..) trigger "cannot find symbol" error in user code

I have some user code in jFlex that generates a BufferedReader from yytext(), then has it pushed into the stream stack. However, it seems that yypushStream(), yypopStream(), yymoreStreams() methods are not recognized by javac and trigger a "cannot…
jsa
  • 397
  • 2
  • 14
1
vote
1 answer

JFlex : Reading from multiple files

I recently started using JFlex and came across the need to read from multiple input files in a specific order.When it finishes the first file i want Jflex to continue with its current state and the scanner to continue from the new file. So far…
Alex
  • 550
  • 1
  • 7
  • 19
1
vote
1 answer

Flex function unput(int cahr), In JFlex the same function

We know that in C Flex there is a function unput(int c) which can put the character c back onto the input stream, I wonder if there is a similar function in JFlex. Thx!
1
vote
1 answer

Intellij language plugin: syntax highlighting when editing using JFlex lexer

I am developing an Intellij Vala plugin. I am stuck on making keyword highlighting work while editing the file. When I open the file all keywords (so far just class and ref) are highlighted correctly. However, when I am typing class it does not…
gregorej
  • 571
  • 1
  • 5
  • 18