NCL Composer  0.1.5
 All Classes Functions Variables Pages
NCLLanguageProfile.cpp
1 /* Copyright (c) 2011 Telemidia/PUC-Rio.
2  * All rights reserved. This program and the accompanying materials
3  * are made available under the terms of the Eclipse Public License v1.0
4  * which accompanies this distribution, and is available at
5  * http://www.eclipse.org/legal/epl-v10.html
6  *
7  * Contributors:
8  * Telemidia/PUC-Rio - initial API and implementation
9  */
10 #include "NCLLanguageProfile.h"
11 #include "NCLDocumentParser.h"
12 #include "NCLStructure.h"
13 
14 using namespace composer::language;
15 
16 NCLLanguageProfile::NCLLanguageProfile()
17 {
18 }
19 
20 NCLLanguageProfile::~NCLLanguageProfile()
21 {
22 
23 }
24 
25 LanguageType NCLLanguageProfile::getLanguageType()
26 {
27  return NCL;
28 }
29 
30 QString NCLLanguageProfile::getProfileName()
31 {
32  return "Nested Context Language Profile";
33 }
34 
35 QList<QString> NCLLanguageProfile::getOutputDocumentTypes()
36 {
37  QList<QString> list;
38  list.append("ncl");
39  return list;
40 }
41 
42 IDocumentParser* NCLLanguageProfile::createParser (Project *project)
43 {
44  return new NCLDocumentParser (project);
45 }
46 
47 void NCLLanguageProfile::releaseDocumentParser (IDocumentParser *parser)
48 {
49  if (parser)
50  {
51  delete parser;
52  parser = NULL;
53  }
54 }
55 
56 map <QString, map <QString, char> *> *NCLLanguageProfile::getNesting()
57 {
58  return NCLStructure::getInstance()->getNesting();
59 }
60 
61 map <QString, bool> *NCLLanguageProfile::getAttributes (QString element)
62 {
63  return NCLStructure::getInstance()->getAttributes(element);
64 }
65 
66 map <QString, char> *NCLLanguageProfile::getChildren (QString tagname)
67 {
68  return NCLStructure::getInstance()->getChildren(tagname);
69 }
70 
71 vector <AttributeReferences *>
72  NCLLanguageProfile::getReferences (QString element, QString attr)
73 {
74  return NCLStructure::getInstance()->getReferences(element, attr);
75 }
76 
77 Q_EXPORT_PLUGIN2(NCLLanguageProfile, NCLLanguageProfile)