Difference between revisions of "Syntax checking/SRS"

(Parser)
Line 3: Line 3:
  
 
= Parser =
 
= Parser =
# Should only parse when neccessary, using timer function or after certain input (like spaces, enter) (to be further specified )
+
# Should only parse when neccessary:
# Provide errors in adequate datastructure to visualisation components (linenumber, type of error, further information)
+
## When editing a new or correct expression:
# On error, parser should call event handler provided by visualization components
+
### After typing a point, comma, colon, semi-colon, space, tab or line-break
 +
### After leaving the edited expression (using courser or mouse)
 +
## When editing a incorrect expression:
 +
### After each added character
 +
# Provide errors in adequate datastructure to visualisation components
 +
##linenumber
 +
##type of error
 +
##further information)
 +
# Whenever the visualisation of an expression should change, the parser should call an event handler provided by visualization components
 +
 
 +
  '''Note:'''
 +
  * A new expression is correct until it becomes incorrect.
 +
  * The state of an expression can only be changed when the cursor leaves it.
  
 
= Visualization =
 
= Visualization =

Revision as of 09:11, 2 May 2006

Goal

Provide adequate, but non intrusive feedback to user about syntax errors.

Parser

  1. Should only parse when neccessary:
    1. When editing a new or correct expression:
      1. After typing a point, comma, colon, semi-colon, space, tab or line-break
      2. After leaving the edited expression (using courser or mouse)
    2. When editing a incorrect expression:
      1. After each added character
  2. Provide errors in adequate datastructure to visualisation components
    1. linenumber
    2. type of error
    3. further information)
  3. Whenever the visualisation of an expression should change, the parser should call an event handler provided by visualization components
  Note:
  * A new expression is correct until it becomes incorrect.
  * The state of an expression can only be changed when the cursor leaves it.

Visualization

  1. Provides event handler and register it to parser error-event
  2. Underline syntax errors using a (preferably wavy) red line
  3. On mouse over, show information on error
  4. Information window could be clickabel to provide further error information

Suggestions

  1. To be implemented after parser and visualization components are feature complete
  2. Suggestions based on information from parse tree
  3. Analyzation based on soundex or other algorithm