-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements on generated parsers v.1.0.2
- Loading branch information
Markus Brigl
committed
Nov 17, 2024
1 parent
1a42b6b
commit 619cfb8
Showing
15 changed files
with
137 additions
and
133 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2024 HiveVM.ORG. All rights reserved. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
package org.hivevm.cc; | ||
|
||
import java.io.File; | ||
|
||
import org.hivevm.cc.parser.JavaCCErrors; | ||
|
||
/** | ||
* The {@link HiveCCTools} class. | ||
*/ | ||
public abstract class HiveCCTools { | ||
|
||
/** | ||
* Constructs an instance of {@link HiveCCTools}. | ||
*/ | ||
private HiveCCTools() {} | ||
|
||
/** | ||
* This prints the banner line when the various tools are invoked. This takes as argument the | ||
* tool's full name and its version. | ||
*/ | ||
public static void bannerLine(String fullName, String ver) { | ||
System.out.print("Java Compiler Compiler Version " + HiveCC.VERSION.toString() + " (" + fullName); | ||
if (!ver.equals("")) { | ||
System.out.print(" Version " + ver); | ||
} | ||
System.out.println(")"); | ||
} | ||
|
||
static void createOutputDir(File outputDir) { | ||
if (!outputDir.exists()) { | ||
JavaCCErrors.warning("Output directory \"" + outputDir + "\" does not exist. Creating the directory."); | ||
|
||
if (!outputDir.mkdirs()) { | ||
JavaCCErrors.semantic_error("Cannot create the output directory : " + outputDir); | ||
return; | ||
} | ||
} | ||
|
||
if (!outputDir.isDirectory()) { | ||
JavaCCErrors.semantic_error("\"" + outputDir + " is not a valid output directory."); | ||
return; | ||
} | ||
|
||
if (!outputDir.canWrite()) { | ||
JavaCCErrors.semantic_error("Cannot write to the output output directory : \"" + outputDir + "\""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.