headers/bsd: Add sys/queue.h.
[haiku.git] / src / kits / debugger / source_language / c_family / CLanguageFamilySyntaxHighlighter.cpp
blob62175145e837a7999ffede57eb40a2d91114cb72
1 /*
2 * Copyright 2014, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "CLanguageFamilySyntaxHighlighter.h"
9 #include <new>
11 #include <AutoDeleter.h>
13 #include "CLanguageFamilySyntaxHighlightInfo.h"
14 #include "CLanguageTokenizer.h"
17 using CLanguage::Tokenizer;
20 CLanguageFamilySyntaxHighlighter::CLanguageFamilySyntaxHighlighter()
22 SyntaxHighlighter()
27 CLanguageFamilySyntaxHighlighter::~CLanguageFamilySyntaxHighlighter()
32 status_t
33 CLanguageFamilySyntaxHighlighter::ParseText(LineDataSource* source,
34 TeamTypeInformation* typeInfo, SyntaxHighlightInfo*& _info)
36 Tokenizer* tokenizer = new(std::nothrow) Tokenizer();
37 if (tokenizer == NULL)
38 return B_NO_MEMORY;
39 ObjectDeleter<Tokenizer> deleter(tokenizer);
41 _info = new(std::nothrow) CLanguageFamilySyntaxHighlightInfo(source,
42 tokenizer, typeInfo);
43 if (_info == NULL)
44 return B_NO_MEMORY;
46 deleter.Detach();
47 return B_OK;