troizet commented on issue #9034:
URL: https://github.com/apache/netbeans/issues/9034#issuecomment-3567964536
`parser.cutter` is needed to split the generated huge parser class into
smaller classes, such as `EncodeActionTable1`, `EncodeActionTable2`, and so on.
Somewhere in the mailing list archives, I found a discussion that
`parser.cutter` wasn't donated by Oracle, so it's not in the repository.
But I found it in the old repositories at http://hg.netbeans.org/releases/.
It seems that this repository is no longer available. If you need it, I can
email it to you.
To generate the parser, java-cup-11a.jar is used, which can be found in
[/php/libs.javacup/external](https://github.com/apache/netbeans/tree/master/php/libs.javacup/external).
I hope @junichi11 will correct me if anything.
I slightly adjusted `build.xml` for the parser assembly,
<details>
<summary>and it looks like this:</summary>
```xml
<!-- add license and @SuppressWarnings for FindBugs in the generated
ASTPHP5Parser & ASTPHP5Symbols files -->
<!-- parsercutter can be found in misc repository -->
<target name="gen-astparser">
<taskdef name="javacup"
classname="java_cup.anttask.CUPTask"
classpath="${nb_all}/php/libs.javacup/external/java-cup-11a.jar"
/>
<javacup
srcfile="${nb_all}/php/php.editor/tools/ASTPHP5Parser.cup"
destdir="${nb_all}/php/php.editor/src"
parser="ASTPHP5Parser"
symbols="ASTPHP5Symbols"
interface="on"/>
<taskdef name="parsercutter"
classname="org.netbeans.modules.php.editor.cup.parser.cutter.ParserCutter"
classpath="/home/troizet/dev/parser.cutter/dist/parser.cutter.jar" />
<parsercutter
parserpath="${nb_all}/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java"
/>
<replaceregexp match="[ \t]+$" replace="" byline="true" >
<fileset
dir="${nb_all}/php/php.editor/src/org/netbeans/modules/php/editor/parser">
<include name="ASTPHP5Parser.java"/>
<include name="EncodedActionTable*.java"/>
</fileset>
</replaceregexp>
<replace
file="src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java">
<replacetoken>public class ASTPHP5Parser extends
java_cup.runtime.lr_parser {</replacetoken>
<replacevalue><![CDATA[@org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP",
"MS_PKGPROTECT", "BC_BAD_CAST_TO_CONCRETE_COLLECTION"})
public class ASTPHP5Parser extends java_cup.runtime.lr_parser
{]]></replacevalue>
</replace>
<replace>
<fileset dir="src/org/netbeans/modules/php/editor/parser">
<include name="ASTPHP5Parser.java"/>
<include name="ASTPHP5Symbols.java"/>
</fileset>
<replacetoken>
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
</replacetoken>
<replacevalue>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
</replacevalue>
</replace>
</target>
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists