java.lang.Object
simula.compiler.utilities.Util
A set of all static Utility Methods
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Utility method: ASSERTprivate static String
Edit a line with source line number etc.static boolean
Returns true if the two specified strings are equal to one another.static void
Print a error message.private static void
Perform FORCED EXIT.static void
Print a internal error message.static void
Print a internal error message.static int
IPOW
(long base, long x) Utility: Integer Power: b ** xstatic boolean
isJavaIdentifier
(String ident) Check if 'ident' is a legal Java Identifier.static String
makeJavaIdentifier
(String ident) Make 'ident' a legal Java Identifier.static int
optionDialog
(Object msg, String title, int optionType, int messageType, String... option) Brings up an option dialog.static void
popUpError
(String msg) Pop up an error message box.static void
popUpMessage
(Object msg) Pop up a message box.static void
printError
(String s) Print a error message.static void
Print a string.static void
Print a warning message.static void
Utility method: TRACEstatic void
TRACE_INPUT
(String msg) Utility method: TRACE_INPUTstatic void
TRACE_OUTPUT
(String msg) Utility method: TRACE_OUTPUTstatic void
Print a warning message.
-
Field Details
-
nError
public static int nErrorNumber of error messages.
-
-
Constructor Details
-
Util
Util()Default constructor.
-
-
Method Details
-
popUpMessage
Pop up a message box.- Parameters:
msg
- the message
-
popUpError
Pop up an error message box.- Parameters:
msg
- the error message
-
optionDialog
public static int optionDialog(Object msg, String title, int optionType, int messageType, String... option) Brings up an option dialog.- Parameters:
msg
- the message to displaytitle
- the title string for the dialogoptionType
- an integer designating the options available on the dialogmessageType
- an integer designating the kind of message this isoption
- an array of objects indicating the possible choices the user can make- Returns:
- an integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the dialog
-
error
Print a error message.- Parameters:
msg
- the message
-
IERR
Print a internal error message.- Parameters:
msg
- the message
-
FORCED_EXIT
private static void FORCED_EXIT()Perform FORCED EXIT. -
IERR
Print a internal error message.- Parameters:
msg
- the messagee
- any Throwable
-
warning
Print a warning message.- Parameters:
msg
- the message
-
edLINE
Edit a line with source line number etc.- Parameters:
s
- the line string- Returns:
- the resulting string
-
TRACE
Utility method: TRACE- Parameters:
msg
- the message to print
-
TRACE_OUTPUT
Utility method: TRACE_OUTPUT- Parameters:
msg
- the message to print
-
TRACE_INPUT
Utility method: TRACE_INPUT- Parameters:
msg
- the message to print
-
ASSERT
Utility method: ASSERT- Parameters:
test
- this test must be truemsg
- the message when test = false
-
println
Print a string.- Parameters:
s
- the string
-
printError
Print a error message.- Parameters:
s
- the message
-
printWarning
Print a warning message.- Parameters:
s
- the message
-
isJavaIdentifier
Check if 'ident' is a legal Java Identifier.- Parameters:
ident
- the given identifier- Returns:
- true if 'ident' is a legal Java Identifier otherwise false
-
makeJavaIdentifier
Make 'ident' a legal Java Identifier.- Parameters:
ident
- the given identifier- Returns:
- the resulting Java identifier
-
equals
Returns true if the two specified strings are equal to one another.- Parameters:
s1
- argument strings2
- argument string- Returns:
- true if the two specified strings are equal to one another
-
IPOW
public static int IPOW(long base, long x) Utility: Integer Power: b ** x- Parameters:
base
- argument basex
- argument x- Returns:
- Returns the value of 'base' raised to the power of 'x'
-