Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Backend: Add line number support. #217

Merged
merged 1 commit into from
Dec 18, 2017

Commits on Dec 18, 2017

  1. Java Backend: Add line number support to match help documentation.

    Currently the help message includes the following for Java:
      Special options for the Java backend
        -l                        Add and set line_number field for all syntax classes
    The only place this support existed was in the help documentation. A quick
    glance through the Java backend files will show that the Option.linenumbers was
    never inspected. This change adds that support for parsing.
    
    Cup's "Symbol" class only supports character offsets, so we use its
    "ComplexSymbol" class, which supports line, column, and offset. JLex does not
    provide column info, but JFlex does. ComplexSymbol tracks the left and right
    extents of a production, and so for variable length tokens we capture this info.
    
    The abstract syntax classes still do not record line information, but the
    necessary information is now available during parsing, and a follow-up commit
    will handle adding the info to the Absyn classes and code to record it to the
    generated cup file.
    iteratee committed Dec 18, 2017
    Configuration menu
    Copy the full SHA
    856d2db View commit details
    Browse the repository at this point in the history