Code Monkey home page Code Monkey logo

Comments (6)

lsf37 avatar lsf37 commented on July 20, 2024

IIRC, it should already be using a relative path which should be stable. The current version is 1.8.2 -- does it happen with that as well?

from jflex.

hurricup avatar hurricup commented on July 20, 2024

Unfortunately I can't check, because we are using patched version of jflex. Could you please point me to the piece of code responsible for that? I tried to look yesterday, but couldn't find it :(

Does it use same slashes on windows/non-windows?

from jflex.

lsf37 avatar lsf37 commented on July 20, 2024

The code is this here

public static String sourceFileString(File file) {
String path = FileUtils.getRelativePath(Options.getRootDirectory(), file);
if (File.separatorChar == '\\') {
path = FileUtils.slashify(path);
}
// Character '\' can be use for Unicode representation, e.g. \\u000A is new line
return path.replace("\\", "\\\\");
}

which is called in emitHeader:

private void emitHeader() {
println("// DO NOT EDIT");
println("// Generated by JFlex " + Build.VERSION + " http://jflex.de/");
println("// source: " + sourceFileString(inputFile));
println("");
}

In 1.7.0, emitHeader isn't in its own function yet, but if you search for generated by in Emitter.java you should find it. If you're using a patched version anyway, you could just delete that line that emits the source file name.

from jflex.

hurricup avatar hurricup commented on July 20, 2024

Thank you!!!

from jflex.

lsf37 avatar lsf37 commented on July 20, 2024

I'll leave this open as possible enhancement, because we probably still get different versions of the path in current versions depending on the platform the lexer was generated on.

from jflex.

lsf37 avatar lsf37 commented on July 20, 2024

Closing this, because in 1.8.2 JFlex does already normalise the path to slashes, i.e. the output should not depend on the host OS.

from jflex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.