Easy to Learn

The Treescript language is based on Java, but unlike Java, only parentheses are used for grouping (no square brackets or curly brackets), and statements/declarations are separated with semicolons. When in the code editor, the user is always in one of 3 code entry modes: free form, structure editor, and code menu. The question mark (?) is used to enter code menu mode. The Escape key toggles between free form and structure editor modes. Structure Editor mode is (possibly) unavailable when the syntax mode is infix (binary operators come in-between their operands). Syntax mode defaults to prefix (all operators come before their operands), and code entry mode defaults to structure editor.

 

Structure Mode Commands

A bottom-level token (e.g. a keyword, identifier, operator, or constant) or an entire list is often highlighted. Using the Shift key in conjunction with the Up/Down Arrow keys, it is possible to select more than one token/list at a time.

·      Esc – toggle between Free Form and Structure Editor modes

·      Up Arrow - go to previous list element

·      Down Arrow - go to next list element

·      Left Arrow - go to parent list

·      Right Arrow - go to first child element (if none, display text cursor following current bottom-level token)

·      Shift+Up/Down Arrow - select a range of tokens/lists

·      Printable Char. - incrementally select valid matching menu item (if any)

·      Backspace - undo insertion of previous printable char.

·      Delete - delete current token/list

·      Enter - display text cursor, insert space after cursor (or insert result of incremental menu selection)

·      Space - display text cursor, insert space before cursor (or insert result of incremental menu selection)

·      Ctrl+Enter – if at end of line, append blank line (otherwise break line into 2 lines)

 

Code Menu Commands

A popup menu above or below text cursor (and including text cursor) is displayed. The contents of this menu include all valid code elements in the context of the text cursor (ignoring anything after the text cursor). If the current menu item refers to a list, the entire list is highlighted (defaults to light gray if background color of whitespace is white).

·      Question Mark - toggle between Code Menu and Free Form/Structure Editor modes

·      Esc - show/hide code menu

·      Up Arrow - move selection up (scroll up after pressing Esc)

·      Down Arrow - move selection down (scroll down after pressing Esc)

·      Left Arrow - go to parent code menu

·      Right Arrow - go to lower-level code menu, if any

·      Enter - go to lower-level code menu (if none, insert current menu item, go to next menu item, or if none, go to parent code menu)

·      Space - go to lower-level code menu (if none, insert current menu item, go to next menu item, or if none, go to parent code menu; exit Code Menu mode)

·      Printable Char. - incrementally select matching menu item

·      Backspace - undo operation of previous printable char.

·      Page Up -  page up after pressing Esc

·      Page Down - page down after pressing Esc

·      Shift Arrow – only used if current menu item is repeated, such as a statement in a block, a declaration, or a parameter in a parameter list

·      Shift Up Arrow – select previous instance of current menu item

·      Shift Down Arrow - select next instance of current menu item

·      Shift Left Arrow – insert above current menu item

·      Shift Right Arrow - insert below current menu item

·      Semicolon – toggle parent list: multi-line/single-line

 

Keyboard Aid

This feature eases code entry by enabling the user to enter commonly used characters which are relatively hard to type with more easily-typed characters.

·      Hyphen: press apostrophe (‘). Use the double-quote (“) for string literals.

·      Code Menu Mode: press slash (/). Use the question mark (?) to enter divide-by (/).

·      Parentheses: press comma (,) for the open parenthesis, and period (.) for the close parenthesis. Use the close parenthesis to enter a decimal point.

·      Hyphen (alternate): when entering an identifier, hold down the Shift key and while doing that, press a letter key. This will enter a hyphen (-) followed by a lowercase letter.

Keyboard Aid is always disabled inside comments and string literals.

 

RAD-style program development

The JZoneGamer Code Editor is similar to Visual Basic or Delphi, in which the user selects components from the component palette, drops them on the game window, and uses the Object Inspector to modify their design-time properties. The code editor is used to enter all program code, including event handlers.