[CEDET-devel] lexer and parse
Brought to you by:
zappo
From: antoine no <ant...@gm...> - 2012-02-17 18:15:42
|
Hello, I try to make a lexer / parser with cedet, but i am jam with lexer. I use the (wisent-test-lexer (point-min) (point-max)) to test my lexer. I set up the parser than when i press C-, , it parse to %start, now all seems normal. I toggle the 2 wisent--flag to see error in *Message*. with an example like this: type <test-type> syntax "some regexp" type <test-type> matchdatatype string %token <test-type> TERMINAL "my-terminal" when i run the parser my token are recognize as "test-type". when i start the lexer i get token of type TERMINAL as expected, but when i run the parser they are recognise of type <test-type>. My other problem with lexer is with my another example: %type <scala-symbol> syntax "\\('\\)?\\([a-zA-Z]+\\)\\(\\sw\\|\\s_\\)*\\(_\\(\\+\\||\\|=\\|@\\|:\\|<\\|>\\|#\\|%\\|\\^\\|-\\|~\\|&\\|!\\|\\?\\|\\*\\|\\\\\\|/\\)+\\)?" %type <scala-symbol> matchdatatype regexp %token <scala-symbol> VARID "[a-z].*" %token <scala-symbol> PLAINID "[A-Z].*" %token <scala-symbol> SYMBOL "'.+" Here scala-symbol recognise a string like: abc_:: So it should give me a lexer VARID, it does but the lexer is just "abc_" missing the "::". if i try: 'abc_:: The lexer is SYMBOL and it is complete ("'abc_::"). Maybe there is more convenient way to test lexer/parser? Thanks you. |