| Home >> All >> org >> jext >> [ dawn Javadoc ] |
| | org.jext.dawn.array.* (9) | | org.jext.dawn.err.* (4) | | org.jext.dawn.io.* (15) |
| | org.jext.dawn.javaccess.* (7) | | org.jext.dawn.loop.* (3) | | org.jext.dawn.math.* (21) |
| | org.jext.dawn.naming.* (4) | | org.jext.dawn.stack.* (18) | | org.jext.dawn.string.* (20) |
| | org.jext.dawn.test.* (20) | | org.jext.dawn.util.* (15) |
org.jext.dawn: Javadoc index of package org.jext.dawn.
Package Samples:
org.jext.dawn.loop
org.jext.dawn.test
org.jext.dawn.io
org.jext.dawn.stack
org.jext.dawn.string
org.jext.dawn.math
org.jext.dawn.javaccess
org.jext.dawn.array
org.jext.dawn.err
org.jext.dawn.naming
org.jext.dawn.util
Classes:
DawnParser: DawnParser is the Dawn scripting language interpreter. Dawn is a language based on RPN. Dawn is also a very modulary language. Basic usage of Dawn is: DawnParser.init(); // code is a String containing the script DawnParser parser = new DawnParser(new StringReader(code)); try { parser.exec(); } catch (DawnRuntimeException dre) { System.err.println(dre.getMessage()); } Note the call to init() . You may not want to call this method, but if you don't, then Dawn will provide NO FUNCTION AT ALL. Even basic ones, like + - * drop sto rcl, won't work !! This is due to the fact Dawn can be entirely customized. ...
CodeSnippet: The CodeSnippet class stands for an interface for Dawn code snippets. A code snippet is a mini-script written in Dawn which will be used by DawnParser to create a function. Code snippets avoid writting annoying Java source code which can generate errors and be a pain to debug.
Function: The Function class defines the standard framework of any Dawn function. A function is defined by its name, the one which will be used to call it from scripts. The function also provides an invoke() method which can throw a DawnRuntimeException on error.
OpenOutputFunction: Opens a file from the HD to write in it. The opened file is designed by an ID. Usage: file ID openForOutput Where file and ID are both string. First one is the path to the file - which can be either absolute, either relative -, and the second one is the file ID.
OpenInputFunction: Opens a file from the HD. The opened file is designed by an ID. Usage: file ID openForInput Where file and ID are both string. First one is the path to the file - which can be either absolute, either relative -, and the second one is the file ID.
DawnRuntimeException: DawnRuntimeException is thrown whenever a function encounter an error. Basically, this exception is thrown if a function is not implemented. Yet, many functions will use it to warn user (i.e: empty stack, not enough arguments, etc...).
FileManager: Manages the files for the whole IO package. This class provides functions to open/close files and also to read/write into them. Each opened file is stored as a property in DawnParser . Each file is designed by a given ID.
LengthFunction: Returns the length of a given array. The length of an array represents the total amount of elements put in it. Usage: array length Then this function pushes the array length AND the array on stack.
FormattedDateFunction: Displays a formatted date. Usage: format fdate Format example: "MM/dd/yyyy - HH:mm:ss" MM stands for month, dd for day, yyyy for year, HH for hours, mm for minutes and ss for seconds.
TokenizeFunction: Tokenizes a string using a set of default delimiters: "\n \r\f\t" Usage: string tokenize It then returns a string per token and the number of tokens on the top of the stack.
TokenizeDelimFunction: Tokenizes a string using a specified set of delimiters. Usage: string delims tokenize It then returns a string per token and the number of tokens on the top of the stack.
ElementAtFunction: Returns the element stored at the given index of an array. Usage: array index elementAt This function then pushes both the array and the object on the stack.
ExecFunction: Executes an OS command. Usage: string exec Where string contains the command to be executed. When command terminates, Dawn pushes the exit code on stack.
AddElementFunction: Adds an element at the end of a given array. Usage: array object addElement Then, the array is pushed on the stack with the new object in it.
RollDownFunction: Rotates the n first elements of the stack by putting each one to the previous level but the first one which goes at last pos. Usage: number rolld
RollFunction: Rotates the n first elements of the stack by putting each one to the next level but the first one which goes on top. Usage: number roll
IfFunction: This class provides an implementation of the if/else statement. Usage: if [condition] then [code] else [code] end else is optional.
LastPosFunction: Returns the last index of a string in another one. Usage: string1 string2 lastPos Returns last index of string2 in string1.
LineSeparatorFunction: As each OS has a different line separator (\n, \r\n, etc...), this function puts the OS one on the stack. Usage: lineSeparator
StartsWithFunction: Test if a string begins with another one. Usage: string1 string2 startsWith Returns 1.0 if string1 begins with string2.
ConstructorFunction: Returns a constructor. Usage: class string constructor Returns the constructor of the given class and declaration.
EndsWithFunction: Test if a string ends with another one. Usage: string1 string2 endsWith Returns 1.0 if string1 ends with string2.
TryCatchFunction: Try catch block: catches any exception in the block and void the parser to stop. Usage: try [code] catch [code] err
SubFunction: Returns a part of a string. Usage: string start end sub Returns the portion of 'string' between start and end.
PosFunction: Returns the index of a string in another one. Usage: string1 string2 pos Returns index of string2 in string1.
| Home | Contact Us | Privacy Policy | Terms of Service |