To program a highlighter, you need to program a lexer.
-- Terminals
Letter = [ "A".."Z" ] | [ "a".."z" ] ;
Digit = [ "0".."9" ] ;
-- Nonterminals
Types = "Int" | "String" | "Short" ;
Ident = Letter { Letter | Digit } ;
Parameter = Ident ":" Types ;
ParameterList = "(" Parameter { "," Parameter } ")" ;
Function = "Function" Parameter ParameterList "EndFunction" ;
Like this.
Very compilcated :)
Have fun!
cu olli
Function Test:Short(Blub:Int=8, Blub2:String="hello") EndFunction
-- Terminals
Letter = [ "A".."Z" ] | [ "a".."z" ] ;
Digit = [ "0".."9" ] ;
-- Nonterminals
Types = "Int" | "String" | "Short" ;
Ident = Letter { Letter | Digit } ;
Parameter = Ident ":" Types ;
ParameterList = "(" Parameter { "," Parameter } ")" ;
Function = "Function" Parameter ParameterList "EndFunction" ;
Like this.
Very compilcated :)
Have fun!
cu olli