//
// Macro definitions. Parameters may be specified and the replacement text terminates with the end of
// line (watch trailing blanks).
//
#define st_DEFAULT          0
#define st_COMMENT          1
#define st_IDENTIFIER       2
#define st_STRING           3
#define st_NUMBER           4
#define st_SYMBOL           5
#define st_RESERVED         6
#define st_COMMENT_LINE     7
#define st_COMMENT_STAR     8
#define st_ESQL             9

#define st_CUSTOM           10

#define st_CUST_KEYWORD     11
#define st_CUST_COMMENT     12
#define st_CUST_STRING      13
#define st_CUST_NUMBER      14
#define st_CUST_SYMBOL      15

#define _non_alpha_                 '[^_A-Za-z0-9]'
#define _all_chars_                 '[\x00-\xFF]'
#define _no_chars_                  '[]'
#define _dont_care_                 _all_chars_

%%language
Name                     = 'Java'
Case                      = __SENSITIVE
// Options                   = __DEFAULT_OPTIONS
// WordWrapColumn            = _EDGE
Gutter                    = _DEFAULT_GUTTER
// Anchor                    = _DEFAULT_START_ANCHOR

EditableStyles              ('Reserved word', st_RESERVED),
                            ('Comment',       st_COMMENT),
                            ('Identifier',    st_IDENTIFIER),
                            ('String',        st_STRING),
                            ('Number',        st_NUMBER),
                            ('Symbols',       st_SYMBOL),
                            ('Default',       st_DEFAULT)

%%words
','                         _dont_care_       st_SYMBOL
'='                         _dont_care_       st_SYMBOL
'+='                        _dont_care_       st_SYMBOL
'-='                        _dont_care_       st_SYMBOL
'*='                        _dont_care_       st_SYMBOL
'/='                        _dont_care_       st_SYMBOL
'%='                        _dont_care_       st_SYMBOL
'<<='                       _dont_care_       st_SYMBOL
'>>='                       _dont_care_       st_SYMBOL
'>>>='                      _dont_care_       st_SYMBOL
'&='                        _dont_care_       st_SYMBOL
'^='                        _dont_care_       st_SYMBOL
'|='                        _dont_care_       st_SYMBOL
'?:'                        _dont_care_       st_SYMBOL
'||'                        _dont_care_       st_SYMBOL
'&&'                        _dont_care_       st_SYMBOL
'|'                         _dont_care_       st_SYMBOL
'^'                         _dont_care_       st_SYMBOL
'&'                         _dont_care_       st_SYMBOL
'=='                        _dont_care_       st_SYMBOL
'!='                        _dont_care_       st_SYMBOL
'<'                         _dont_care_       st_SYMBOL
'<='                        _dont_care_       st_SYMBOL
'>'                         _dont_care_       st_SYMBOL
'>='                        _dont_care_       st_SYMBOL
'<<'                        _dont_care_       st_SYMBOL
'>>'                        _dont_care_       st_SYMBOL
'>>>'                       _dont_care_       st_SYMBOL
'+'                         _dont_care_       st_SYMBOL
'-'                         _dont_care_       st_SYMBOL
'*'                         _dont_care_       st_SYMBOL
'/'                         _dont_care_       st_SYMBOL
'%'                         _dont_care_       st_SYMBOL
'!'                         _dont_care_       st_SYMBOL
'~'                         _dont_care_       st_SYMBOL
'++'                        _dont_care_       st_SYMBOL
'--'                        _dont_care_       st_SYMBOL
'('                         _dont_care_       st_SYMBOL
')'                         _dont_care_       st_SYMBOL
'['                         _dont_care_       st_SYMBOL
']'                         _dont_care_       st_SYMBOL
'.'                         _dont_care_       st_SYMBOL

'\/*'                       _dont_care_       st_COMMENT_STAR
'\/\/'                      _dont_care_       st_COMMENT_LINE
'#sql'                      _dont_care_       st_ESQL

'abstract'                  _non_alpha_       st_RESERVED
'boolean'                   _non_alpha_       st_RESERVED
'break'                     _non_alpha_       st_RESERVED
'byte'                      _non_alpha_       st_RESERVED
'byvalue'                   _non_alpha_       st_RESERVED
'case'                      _non_alpha_       st_RESERVED
'cast'                      _non_alpha_       st_RESERVED
'catch'                     _non_alpha_       st_RESERVED
'char'                      _non_alpha_       st_RESERVED
'class'                     _non_alpha_       st_RESERVED
'const'                     _non_alpha_       st_RESERVED
'continue'                  _non_alpha_       st_RESERVED
'default'                   _non_alpha_       st_RESERVED
'do'                        _non_alpha_       st_RESERVED
'double'                    _non_alpha_       st_RESERVED
'else'                      _non_alpha_       st_RESERVED
'extends'                   _non_alpha_       st_RESERVED
'false'                     _non_alpha_       st_RESERVED
'final'                     _non_alpha_       st_RESERVED
'finally'                   _non_alpha_       st_RESERVED
'float'                     _non_alpha_       st_RESERVED
'for'                       _non_alpha_       st_RESERVED
'future'                    _non_alpha_       st_RESERVED
'generic'                   _non_alpha_       st_RESERVED
'goto'                      _non_alpha_       st_RESERVED
'if'                        _non_alpha_       st_RESERVED
'implements'                _non_alpha_       st_RESERVED
'import'                    _non_alpha_       st_RESERVED
'inner'                     _non_alpha_       st_RESERVED
'instanceof'                _non_alpha_       st_RESERVED
'int'                       _non_alpha_       st_RESERVED
'interface'                 _non_alpha_       st_RESERVED
'long'                      _non_alpha_       st_RESERVED
'native'                    _non_alpha_       st_RESERVED
'new'                       _non_alpha_       st_RESERVED
'null'                      _non_alpha_       st_RESERVED
'operator'                  _non_alpha_       st_RESERVED
'outer'                     _non_alpha_       st_RESERVED
'package'                   _non_alpha_       st_RESERVED
'private'                   _non_alpha_       st_RESERVED
'protected'                 _non_alpha_       st_RESERVED
'public'                    _non_alpha_       st_RESERVED
'rest'                      _non_alpha_       st_RESERVED
'return'                    _non_alpha_       st_RESERVED
'short'                     _non_alpha_       st_RESERVED
'static'                    _non_alpha_       st_RESERVED
'super'                     _non_alpha_       st_RESERVED
'switch'                    _non_alpha_       st_RESERVED
'synchronized'              _non_alpha_       st_RESERVED
'this'                      _non_alpha_       st_RESERVED
'throw'                     _non_alpha_       st_RESERVED
'throws'                    _non_alpha_       st_RESERVED
'transient'                 _non_alpha_       st_RESERVED
'true'                      _non_alpha_       st_RESERVED
'try'                       _non_alpha_       st_RESERVED
'var'                       _non_alpha_       st_RESERVED
'void'                      _non_alpha_       st_RESERVED
'volatile'                  _non_alpha_       st_RESERVED
'while'                     _non_alpha_       st_RESERVED

%%handler
st_COMMENT_LINE         '[^\n]'?                    '\n'           _discard_
st_COMMENT_STAR         _all_chars_?                '*\/'          _use_
st_ESQL                 _all_chars_?                '}'            _use_

%%tokens
st_STRING               __STD_C_STRING
st_STRING               __STD_C_CHAR
st_IDENTIFIER           __STD_IDENTIFIER
st_NUMBER               __STD_NUMBER_OR_FP

%%map
%%map
st_DEFAULT         st_DEFAULT
st_IDENTIFIER      st_IDENTIFIER
st_STRING          st_STRING
st_COMMENT         st_COMMENT
st_COMMENT_LINE    st_COMMENT
st_COMMENT_STAR    st_COMMENT
st_RESERVED        st_RESERVED
st_SYMBOL          st_SYMBOL
st_NUMBER          st_NUMBER
st_ESQL            st_DEFAULT

st_CUSTOM          st_CUSTOM

st_CUST_KEYWORD    st_RESERVED
st_CUST_COMMENT    st_COMMENT
st_CUST_STRING     st_STRING
st_CUST_NUMBER     st_NUMBER
st_CUST_SYMBOL     st_SYMBOL

