Skip to content

Commit

Permalink
Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Oct 24, 2024
1 parent 40bee04 commit 3e4d8d5
Showing 1 changed file with 170 additions and 11 deletions.
181 changes: 170 additions & 11 deletions exaudfclient/docs/script_options_requirments.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,105 @@ This section details the high-level requirements for the new parser system, link
### General Script Options Parsing
`req~general-script-options-parsing~1`

The parser must correctly identify and handle Script Options with the syntax `%<optionKey><white spaces><optionValue>;`. It must also manage white spaces and ignore non-Script Options as specified.
The parser must correctly identify and handle Script Options with the syntax `%<optionKey><white spaces><optionValue>;`.
The separator between

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`

### White Spaces
`req~white-spaces~1`

The following is the list of white spaces:
|=======================================================
| Name | C/Python/Java | ASCII Dec | ASCII Hex |
| tabulator | '\t' | 9 | 0x09 |
| vertical tab | '\v' | 11 | 0x0b |
| form feed | '\f' | 12 | 0x0c |
| space | ' ' | 30 | 0x20 |
|=======================================================

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`


### Leading White Spaces Options Parsing
`req~leading-white-spaces-script-options-parsing~1`

The parser must recognize Script Options for lines starting with white space characters.

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`

Depends:
- `req~white-spaces~1`

### Ignore anything which is not a Script Option
`req~ignore-none-script-options~1`

If there is any character in front of a Script Option which is not a white space, the parser must ignore the option(s).

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`

Depends:
- `req~white-spaces~1`

### Multiple Line Script Options Parsing
`req~multiple-lines-script-options-parsing~1`

The parser must recognize Script Options at any line in the given script code.

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`

### White Spaces Options Parsing V1
`req~white-spaces-script-options-parsing-v1~1`

All white spaces between the option key and option value are to be interpreted as separator.
White spaces between the option value and the terminating ";" are to be removed from the option value.

Needs: dsn

Tags: V1

Covers:
- `feat~general-script-options-parsing~1`

Depends:
- `req~white-spaces~1`

### White Spaces Options Parsing V2
`req~white-spaces-script-options-parsing-v2~1`

All white spaces between the option key and option value are to be ignored. The following rules for escape sequences at **the start** of a script optionValue are to be applied:
- '\ ' => space character
- '\t' => <tab> character
- '\f' => <form feed> character
- '\v' => <vertical tab> character

White spaces between the option value and the terminating ";" shall remain.

Needs: dsn

Tags: V2

Covers:
- `feat~general-script-options-parsing~1`

Depends:
- `req~white-spaces~1`

### Multiple and Options
`req~multiple-options-management~1`

Expand All @@ -68,38 +160,101 @@ Covers:
### Script Option Removal
`req~script-option-removal~1`

The parser must remove found Script Options from the original script code.
The parser handler must remove found known Script Options from the original script code. Successfully parsed Script Options, which are not recognized by the parser handler shall remain in the script code.

Needs: dsn

Covers:
- `feat~general-script-options-parsing~1`
- `feat~java-specific-script-options~1`


### Escape Sequence Script Options Parsing
`req~escape-sequence-script-options-parsing~1`

The following rules for escape sequences at any place within a script optionValue are to be applied:
- '\n' => <line feed> character
- '\r' => <carriage return> character
- '\;' => ';' character

Needs: dsn

Tags: V2

Covers:
- `feat~general-script-options-parsing~1`


### Java %scriptclass Option Handling V1
`req~java-scriptclass-option-handling-v1~1`

The Java parser handler must correctly identify the first `%scriptclass` option and remove only this single instance from the script code. Any further occurrences of `%scriptclass` option shall stay in the source script code.

Needs: dsn

Tags: V1

Covers:
- `feat~java-specific-script-options~1`


### Java %scriptclass Option Handling V2
`req~java-scriptclass-option-handling-v2~1`

The Java parser handler must correctly identify the first `%scriptclass` option and remove any additional occurrences of this option within the script code.

Needs: dsn

Tags: V2

Covers:
- `feat~java-specific-script-options~1`

### Java %jar Option Handling V1
`req~java-jar-option-handling-v1~1`

The Java parser handler must find multiple %jar options. The values are to be interpreted as the Java CLASSPATH: `<file1>:<file2>:...:<filen>`.
The Java parser handler shall split the entries by the colon character. The Java parser handler shall identify duplicated files and order the result of all `%jar` options alphabetically.

Needs: dsn

Tags: V1

Covers:
- `feat~java-specific-script-options~1`

### Java %scriptclass Option Handling
`req~java-scriptclass-option-handling~1`
### Java %jar Option Handling V2
`req~java-jar-option-handling-v2~1`

The parser must correctly identify the first `%scriptclass` option and remove any additional occurrences of this option within the script code.
The Java parser handler must find multiple %jar options. The values are to be interpreted as the Java CLASSPATH: `<file1>:<file2>:...:<filen>`.
The Java parser handler shall split the entries by the colon character. The Java parser handler must keep duplicates. The order of the entries must not change.

Needs: dsn

Tags: V2

Covers:
- `feat~java-specific-script-options~1`

### Java %jar Option Handling
`req~java-jar-option-handling~1`
### Java %jar Option Trailing White Space Handling
`req~java-jar-option-trailing-white-space-handling~1`

The parser must find multiple %jar options, handle duplicates properly, and ensure the values match the Java CLASSPATH environment variable syntax.
The Java parser handler must remove trailing white spaces for `%jar` option values if they are part of the escape sequence '\ '. Escape sequences at the end of a found `%jar` option of the form `\ ` must be replaced with ' '.
This approach provides backwards compatibility for most existing UDF's from customers.

Needs: dsn

Tags: V2

Covers:
- `feat~java-specific-script-options~1`

Depends:
- `req~white-spaces-script-options-parsing-v2~1`
### Java %jvmoption Handling
`req~java-jvmoption-handling~1`

The parser must find multiple %jvmoption options, allowing duplicates and maintaining order.
The Java parser handler must find multiple %jvmoption options, allowing duplicates and maintaining order.

Needs: dsn

Expand All @@ -109,7 +264,7 @@ Covers:
### Java %import Option Handling
`req~java-import-option-replace-referenced-scripts~1`

For each found %import option, the parser must request and replace the referenced scripts recursively. This means,
For each found %import option, the Java parser handler must request and replace the referenced scripts recursively. This means,
if the referenced scripts contain also `%import` options, the implementation must replace those, too.

Needs: dsn
Expand All @@ -120,7 +275,7 @@ Covers:
### Java %import Option Handling
`req~java-import-option-handling~1`

For each found %import option, the parser must handle nested Script Options appropriately:
For each found %import option, the Java parser handler must handle nested Script Options appropriately:
1. `%scriptclass` option must be ignored, but removed from the script code.
2. All other options must be handled as if they were part of the source script.

Expand All @@ -139,6 +294,8 @@ It is important to avoid additional runtime dependencies, as this would complica

Needs: dsn

Tags: V2

Covers:
- `feat~general-script-options-parsing~1`

Expand All @@ -149,6 +306,8 @@ Ideally, the new parser should allow encapsulation in a custom C++ namespace, in

Needs: dsn

Tags: V2

Covers:
- `feat~general-script-options-parsing~1`

0 comments on commit 3e4d8d5

Please sign in to comment.