Menu

#595 Beauty 0.1 exception javaCC

closed
None
5
2006-04-24
2006-04-24
No

Hi, I tried Beauty with the php parser of
PHPParserPlugin and got this exception

[debug] BeautyThread: beautifying the buffer...
[error] BeautyThread: beauty.parsers.ParserException:
beauty.parsers.javacc.ParseException: Parse error at
line 6424, column 1. Encountered: /
[error] BeautyThread: at
beauty.beautifiers.JavaCCBeautifier.beautify(JavaCCBeautifier.java:38)
[error] BeautyThread: at
beauty.BeautyThread.run(BeautyThread.java:79)
[error] BeautyThread: at
org.gjt.sp.util.WorkThreadPool.addWorkRequest(WorkThreadPool.java:110)
[error] BeautyThread: at
org.gjt.sp.jedit.io.VFSManager.runInAWTThread(VFSManager.java:262)
[error] BeautyThread: at
beauty.BeautyPlugin.beautify(BeautyPlugin.java:54)
[error] BeautyThread: at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] BeautyThread: at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[error] BeautyThread: at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[error] BeautyThread: at
java.lang.reflect.Method.invoke(Unknown Source)
[error] BeautyThread: at
bsh.Reflect.invokeOnMethod(Reflect.java:148)
[error] BeautyThread: at
bsh.Reflect.invokeStaticMethod(Reflect.java:99)
[error] BeautyThread: at
bsh.Name.invokeMethod(Name.java:872)
[error] BeautyThread: at
bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72)
[error] BeautyThread: at
bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
[error] BeautyThread: at
bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
[error] BeautyThread: at
bsh.BSHBlock.evalBlock(BSHBlock.java:130)
[error] BeautyThread: at
bsh.BSHBlock.eval(BSHBlock.java:80)
[error] BeautyThread: at
bsh.BshMethod.invokeImpl(BshMethod.java:349)
[error] BeautyThread: at
bsh.BshMethod.invoke(BshMethod.java:246)
[error] BeautyThread: at
bsh.BshMethod.invoke(BshMethod.java:171)
[error] BeautyThread: at
org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:507)
[error] BeautyThread: at
org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76)
[error] BeautyThread: at
org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:229)
[error] BeautyThread: at
org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:2902)
[error] BeautyThread: at
org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:215)
[error] BeautyThread: at
javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
[error] BeautyThread: at
javax.swing.AbstractButton.doClick(Unknown Source)
[error] BeautyThread: at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown
Source)
[error] BeautyThread: at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
[error] BeautyThread: at
java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
[error] BeautyThread: at
java.awt.Component.processMouseEvent(Unknown Source)
[error] BeautyThread: at
javax.swing.JComponent.processMouseEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Component.processEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Container.processEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Container.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.dispatchEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.Container.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Window.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.run(Unknown Source)
[error] BeautyThread: Caused by:
beauty.parsers.javacc.ParseException: Parse error at
line 6424, column 1. Encountered: /
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.generateParseException(JavaCCParser.java:7927)
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.jj_consume_token(JavaCCParser.java:7879)
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.javacc_input(JavaCCParser.java:148)
[error] BeautyThread: at
beauty.beautifiers.JavaCCBeautifier.beautify(JavaCCBeautifier.java:29)
[error] BeautyThread: ... 51 more

I tried also it with php but it put everything in one
line ...

Discussion

  • Dale Anson

    Dale Anson - 2006-04-24
    • assigned_to: nobody --> daleanson
     
  • Dale Anson

    Dale Anson - 2006-04-24

    Logged In: YES
    user_id=187628

    I don't know what this means:

    "I tried Beauty with the php parser of PHPParserPlugin "

    The bug title references JavaCC. So is the problem
    happening when you're trying to format a javacc file or a
    php file? What does the PHPParserPlugin have to do with it?
    Do you have the Beauty options set so that PHP is
    formatted with the html beautifier and javacc files are
    formatted with the javacc beautifier? I don't know much
    about PHP, so a little more guidance would be helpful.
    Would you attach a PHP file to this bug?

    Thanks,

    Dale

     
  • Dale Anson

    Dale Anson - 2006-04-24

    Logged In: YES
    user_id=187628

    Ah! That makes sense. Note the 0.1 version number for Beauty
    -- it really hasn't had a lot of testing on a wide variety
    of files yet. My main motivators were I wanted a beautifier
    for jsp files and javacc files. The html/jsp beautifying
    seems to work really well, the java and javacc are still a
    bit rough. I'll use your PHPParser.jj file as a test file.

     
  • Dale Anson

    Dale Anson - 2006-04-24

    Logged In: YES
    user_id=187628

    Fix had been checked into jEdit CVS. The problem is the
    PHPParser.jj file has a single line comment at the very end
    of the file without a trailing line separator, which was not
    allowed by the javacc grammar. I've adjusted the grammar to
    support this situation. A short term work around (until the
    next plugin release) would be to add a line separator after
    the last comment.

     
  • Dale Anson

    Dale Anson - 2006-04-24
    • status: open --> closed
     

Log in to post a comment.