add_pattern('OO', "/(?<=[a-z0-9_]')$ident/"); $this->add_pattern('IDENT', "/$ident/"); // http://en.wikibooks.org/wiki/Ada_Programming/Lexical_elements#Numbers // no bnf :( might be wrong $this->add_pattern('NUMERIC', '/\d+#[a-f0-9]*#/i'); $this->add_pattern('NUMERIC', "/[0-9]++[0-9_]*+(\.[0-9_]++)?([eE][\-+]?[0-9_]++)?/"); $this->add_pattern('COMMENT', '/--.*/'); $this->add_pattern('OPERATOR', '@=|/=|>=?|<=?|\+|-|\*\*?|/|&|:=@'); // http://rosettacode.org/wiki/Special_characters#Ada $this->add_pattern('CHARACTER', "/'.'/"); $this->add_pattern('STRING', '/"(?:[^"]++|"")*"/'); $this->add_identifier_mapping('KEYWORD', $kws); $this->add_identifier_mapping('OPERATOR', $ops); $this->add_identifier_mapping('VALUE', $vals); $this->add_identifier_mapping('TYPE', $types); } }