org.radrails.db.internal.ui.editors.sql
Class SQLCodeScanner

java.lang.Object
  extended byorg.eclipse.jface.text.rules.RuleBasedScanner
      extended byorg.radrails.db.internal.ui.editors.sql.SQLCodeScanner
All Implemented Interfaces:
org.eclipse.jface.text.rules.ICharacterScanner, ISQLSyntax, org.eclipse.jface.text.rules.ITokenScanner

public class SQLCodeScanner
extends org.eclipse.jface.text.rules.RuleBasedScanner
implements ISQLSyntax

The SQLCodeScanner is a RuleBaseScanner.This class finds SQL comments and keywords, as the user edits the document. It is "programmed" with a sequence of rules that evaluates and returns the offset and the length of the last found token.


Field Summary
 
Fields inherited from interface org.radrails.db.internal.ui.editors.sql.ISQLSyntax
allWords, constants, functions, predicates, reservedwords, types
 
Fields inherited from interface org.eclipse.jface.text.rules.ICharacterScanner
EOF
 
Constructor Summary
SQLCodeScanner()
          Constructor for SQLCodeScanner.
 
Methods inherited from class org.eclipse.jface.text.rules.RuleBasedScanner
getColumn, getLegalLineDelimiters, getTokenLength, getTokenOffset, nextToken, read, setDefaultReturnToken, setRange, setRules, unread
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLCodeScanner

public SQLCodeScanner()
Constructor for SQLCodeScanner. The SQLCodeScanner, is a RuleBaseScanner. The code scanner creates tokens for keywords, types, and constants. The token is constructed with a TextAttribute. The TextAttribute is constructed with a color and font. A list of rules with the corresponding token are created. The method ends with setting the scanner's set of rules