diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-11-21 20:52:45 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2014-11-21 20:52:45 +0100 |
commit | e21f7f1a6d6cc0ac56ef3a5585f66269275a9133 (patch) | |
tree | 9b87b54e0f91a118c8825a547c601634d79b5b9b | |
parent | 1da7b31f13b00fdf4e572b5847750237f484b505 (diff) |
fixed docu
-rw-r--r-- | src/core/CodeTokenizer.hpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/CodeTokenizer.hpp b/src/core/CodeTokenizer.hpp index b392c11..0b34d53 100644 --- a/src/core/CodeTokenizer.hpp +++ b/src/core/CodeTokenizer.hpp @@ -105,8 +105,27 @@ public: /** * * @param input a BufferedCharReader containing the input for this - *tokenizer, - * as with a regular tokenizer. + * tokenizer, as with a regular tokenizer. + * @param root a TokenTreeNode representing the root of the TokenTree. + * Please note that you have to specify all tokenIDs here that you use + * in the descriptors map. + * @param descriptors a map mapping tokenIDs to CodeTokenDescriptors. + * In this way you can specify the meaning of certain Tokens. Say you + * specified the Token "//" with the id 1 in the TokenTree. Then you could + * add the entry "1" with the Mode "LINE_COMMENT" to the descriptors map + * and this CodeTokenizer would recognize the token "//" as starting a + * line comment. + */ + CodeTokenizer(BufferedCharReader &input, const TokenTreeNode &root, + std::map<int, CodeTokenDescriptor> descriptors) + : Tokenizer(input, root), descriptors(descriptors), state(CodeTokenizerState::NORMAL) + { + } + + /** + * + * @param input a BufferedCharReader containing the input for this + * tokenizer, as with a regular tokenizer. * @param root a TokenTreeNode representing the root of the TokenTree. * Please note that you have to specify all tokenIDs here that you use * in the descriptors map. |