RetroArch
SymbolTable.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
3 // Copyright (C) 2013 LunarG, Inc.
4 //
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
9 // are met:
10 //
11 // Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 //
14 // Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following
16 // disclaimer in the documentation and/or other materials provided
17 // with the distribution.
18 //
19 // Neither the name of 3Dlabs Inc. Ltd. nor the names of its
20 // contributors may be used to endorse or promote products derived
21 // from this software without specific prior written permission.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 // POSSIBILITY OF SUCH DAMAGE.
35 //
36 
37 #ifndef _SYMBOL_TABLE_INCLUDED_
38 #define _SYMBOL_TABLE_INCLUDED_
39 
40 //
41 // Symbol table for parsing. Has these design characteristics:
42 //
43 // * Same symbol table can be used to compile many shaders, to preserve
44 // effort of creating and loading with the large numbers of built-in
45 // symbols.
46 //
47 // --> This requires a copy mechanism, so initial pools used to create
48 // the shared information can be popped. Done through "clone"
49 // methods.
50 //
51 // * Name mangling will be used to give each function a unique name
52 // so that symbol table lookups are never ambiguous. This allows
53 // a simpler symbol table structure.
54 //
55 // * Pushing and popping of scope, so symbol table will really be a stack
56 // of symbol tables. Searched from the top, with new inserts going into
57 // the top.
58 //
59 // * Constants: Compile time constant symbols will keep their values
60 // in the symbol table. The parser can substitute constants at parse
61 // time, including doing constant folding and constant propagation.
62 //
63 // * No temporaries: Temporaries made from operations (+, --, .xy, etc.)
64 // are tracked in the intermediate representation, not the symbol table.
65 //
66 
67 #include "../Include/Common.h"
68 #include "../Include/intermediate.h"
69 #include "../Include/InfoSink.h"
70 
71 namespace glslang {
72 
73 //
74 // Symbol base class. (Can build functions or variables out of these...)
75 //
76 
77 class TVariable;
78 class TFunction;
79 class TAnonMember;
80 
81 class TSymbol {
82 public:
85  virtual TSymbol* clone() const = 0;
86  virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool
87 
88  virtual const TString& getName() const { return *name; }
89  virtual void changeName(const TString* newName) { name = newName; }
90  virtual void addPrefix(const char* prefix)
91  {
92  TString newName(prefix);
93  newName.append(*name);
94  changeName(NewPoolTString(newName.c_str()));
95  }
96  virtual const TString& getMangledName() const { return getName(); }
97  virtual TFunction* getAsFunction() { return 0; }
98  virtual const TFunction* getAsFunction() const { return 0; }
99  virtual TVariable* getAsVariable() { return 0; }
100  virtual const TVariable* getAsVariable() const { return 0; }
101  virtual const TAnonMember* getAsAnonMember() const { return 0; }
102  virtual const TType& getType() const = 0;
103  virtual TType& getWritableType() = 0;
104  virtual void setUniqueId(int id) { uniqueId = id; }
105  virtual int getUniqueId() const { return uniqueId; }
106  virtual void setExtensions(int num, const char* const exts[])
107  {
108  assert(extensions == 0);
109  assert(num > 0);
110  numExtensions = num;
111  extensions = NewPoolObject(exts[0], num);
112  for (int e = 0; e < num; ++e)
113  extensions[e] = exts[e];
114  }
115  virtual int getNumExtensions() const { return numExtensions; }
116  virtual const char** getExtensions() const { return extensions; }
117  virtual void dump(TInfoSink &infoSink) const = 0;
118 
119  virtual bool isReadOnly() const { return ! writable; }
120  virtual void makeReadOnly() { writable = false; }
121 
122 protected:
123  explicit TSymbol(const TSymbol&);
124  TSymbol& operator=(const TSymbol&);
125 
126  const TString *name;
127  unsigned int uniqueId; // For cross-scope comparing during code generation
128 
129  // For tracking what extensions must be present
130  // (don't use if correct version/profile is present).
132  const char** extensions; // an array of pointers to existing constant char strings
133 
134  //
135  // N.B.: Non-const functions that will be generally used should assert on this,
136  // to avoid overwriting shared symbol-table information.
137  //
138  bool writable;
139 };
140 
141 //
142 // Variable class, meaning a symbol that's not a function.
143 //
144 // There could be a separate class hierarchy for Constant variables;
145 // Only one of int, bool, or float, (or none) is correct for
146 // any particular use, but it's easy to do this way, and doesn't
147 // seem worth having separate classes, and "getConst" can't simply return
148 // different values for different types polymorphically, so this is
149 // just simple and pragmatic.
150 //
151 class TVariable : public TSymbol {
152 public:
153  TVariable(const TString *name, const TType& t, bool uT = false )
154  : TSymbol(name),
155  userType(uT),
156  constSubtree(nullptr),
157  anonId(-1) { type.shallowCopy(t); }
158  virtual TVariable* clone() const;
159  virtual ~TVariable() { }
160 
161  virtual TVariable* getAsVariable() { return this; }
162  virtual const TVariable* getAsVariable() const { return this; }
163  virtual const TType& getType() const { return type; }
164  virtual TType& getWritableType() { assert(writable); return type; }
165  virtual bool isUserType() const { return userType; }
166  virtual const TConstUnionArray& getConstArray() const { return constArray; }
168  virtual void setConstArray(const TConstUnionArray& array) { constArray = array; }
169  virtual void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
170  virtual TIntermTyped* getConstSubtree() const { return constSubtree; }
171  virtual void setAnonId(int i) { anonId = i; }
172  virtual int getAnonId() const { return anonId; }
173 
174  virtual void dump(TInfoSink &infoSink) const;
175 
176 protected:
177  explicit TVariable(const TVariable&);
178  TVariable& operator=(const TVariable&);
179 
181  bool userType;
182  // we are assuming that Pool Allocator will free the memory allocated to unionArray
183  // when this object is destroyed
184 
185  // TODO: these two should be a union
186  // A variable could be a compile-time constant, or a specialization
187  // constant, or neither, but never both.
188  TConstUnionArray constArray; // for compile-time constant value
189  TIntermTyped* constSubtree; // for specialization constant computation
190  int anonId; // the ID used for anonymous blocks: TODO: see if uniqueId could serve a dual purpose
191 };
192 
193 //
194 // The function sub-class of symbols and the parser will need to
195 // share this definition of a function parameter.
196 //
197 struct TParameter {
202  {
203  if (param.name)
204  name = NewPoolTString(param.name->c_str());
205  else
206  name = 0;
207  type = param.type->clone();
208  defaultValue = param.defaultValue;
209  }
210  TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; }
211 };
212 
213 //
214 // The function sub-class of a symbol.
215 //
216 class TFunction : public TSymbol {
217 public:
218  explicit TFunction(TOperator o) :
219  TSymbol(0),
220  op(o),
221  defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { }
222  TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) :
223  TSymbol(name),
224  mangledName(*name + '('),
225  op(tOp),
226  defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0)
227  {
228  returnType.shallowCopy(retType);
229  declaredBuiltIn = retType.getQualifier().builtIn;
230  }
231  virtual TFunction* clone() const override;
232  virtual ~TFunction();
233 
234  virtual TFunction* getAsFunction() override { return this; }
235  virtual const TFunction* getAsFunction() const override { return this; }
236 
237  // Install 'p' as the (non-'this') last parameter.
238  // Non-'this' parameters are reflected in both the list of parameters and the
239  // mangled name.
240  virtual void addParameter(TParameter& p)
241  {
242  assert(writable);
243  parameters.push_back(p);
244  p.type->appendMangledName(mangledName);
245 
246  if (p.defaultValue != nullptr)
247  defaultParamCount++;
248  }
249 
250  // Install 'this' as the first parameter.
251  // 'this' is reflected in the list of parameters, but not the mangled name.
252  virtual void addThisParameter(TType& type, const char* name)
253  {
254  TParameter p = { NewPoolTString(name), new TType, nullptr };
255  p.type->shallowCopy(type);
256  parameters.insert(parameters.begin(), p);
257  }
258 
259  virtual void addPrefix(const char* prefix) override
260  {
261  TSymbol::addPrefix(prefix);
262  mangledName.insert(0, prefix);
263  }
264 
265  virtual void removePrefix(const TString& prefix)
266  {
267  assert(mangledName.compare(0, prefix.size(), prefix) == 0);
268  mangledName.erase(0, prefix.size());
269  }
270 
271  virtual const TString& getMangledName() const override { return mangledName; }
272  virtual const TType& getType() const override { return returnType; }
273  virtual TBuiltInVariable getDeclaredBuiltInType() const { return declaredBuiltIn; }
274  virtual TType& getWritableType() override { return returnType; }
275  virtual void relateToOperator(TOperator o) { assert(writable); op = o; }
276  virtual TOperator getBuiltInOp() const { return op; }
277  virtual void setDefined() { assert(writable); defined = true; }
278  virtual bool isDefined() const { return defined; }
279  virtual void setPrototyped() { assert(writable); prototyped = true; }
280  virtual bool isPrototyped() const { return prototyped; }
281  virtual void setImplicitThis() { assert(writable); implicitThis = true; }
282  virtual bool hasImplicitThis() const { return implicitThis; }
283  virtual void setIllegalImplicitThis() { assert(writable); illegalImplicitThis = true; }
284  virtual bool hasIllegalImplicitThis() const { return illegalImplicitThis; }
285 
286  // Return total number of parameters
287  virtual int getParamCount() const { return static_cast<int>(parameters.size()); }
288  // Return number of parameters with default values.
289  virtual int getDefaultParamCount() const { return defaultParamCount; }
290  // Return number of fixed parameters (without default values)
291  virtual int getFixedParamCount() const { return getParamCount() - getDefaultParamCount(); }
292 
293  virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
294  virtual const TParameter& operator[](int i) const { return parameters[i]; }
295 
296  virtual void dump(TInfoSink &infoSink) const override;
297 
298 protected:
299  explicit TFunction(const TFunction&);
300  TFunction& operator=(const TFunction&);
301 
302  typedef TVector<TParameter> TParamList;
303  TParamList parameters;
304  TType returnType;
305  TBuiltInVariable declaredBuiltIn;
306 
307  TString mangledName;
308  TOperator op;
309  bool defined;
310  bool prototyped;
311  bool implicitThis; // True if this function is allowed to see all members of 'this'
312  bool illegalImplicitThis; // True if this function is not supposed to have access to dynamic members of 'this',
313  // even if it finds member variables in the symbol table.
314  // This is important for a static member function that has member variables in scope,
315  // but is not allowed to use them, or see hidden symbols instead.
316  int defaultParamCount;
317 };
318 
319 //
320 // Members of anonymous blocks are a kind of TSymbol. They are not hidden in
321 // the symbol table behind a container; rather they are visible and point to
322 // their anonymous container. (The anonymous container is found through the
323 // member, not the other way around.)
324 //
325 class TAnonMember : public TSymbol {
326 public:
327  TAnonMember(const TString* n, unsigned int m, const TVariable& a, int an) : TSymbol(n), anonContainer(a), memberNumber(m), anonId(an) { }
328  virtual TAnonMember* clone() const;
329  virtual ~TAnonMember() { }
330 
331  virtual const TAnonMember* getAsAnonMember() const { return this; }
332  virtual const TVariable& getAnonContainer() const { return anonContainer; }
333  virtual unsigned int getMemberNumber() const { return memberNumber; }
334 
335  virtual const TType& getType() const
336  {
338  return *types[memberNumber].type;
339  }
340 
342  {
343  assert(writable);
345  return *types[memberNumber].type;
346  }
347 
348  virtual int getAnonId() const { return anonId; }
349  virtual void dump(TInfoSink &infoSink) const;
350 
351 protected:
352  explicit TAnonMember(const TAnonMember&);
354 
356  unsigned int memberNumber;
357  int anonId;
358 };
359 
361 public:
365 
366  bool insert(TSymbol& symbol, bool separateNameSpaces)
367  {
368  //
369  // returning true means symbol was added to the table with no semantic errors
370  //
371  const TString& name = symbol.getName();
372  if (name == "") {
373  symbol.getAsVariable()->setAnonId(anonId++);
374  // An empty name means an anonymous container, exposing its members to the external scope.
375  // Give it a name and insert its members in the symbol table, pointing to the container.
376  char buf[20];
377  snprintf(buf, 20, "%s%d", AnonymousPrefix, symbol.getAsVariable()->getAnonId());
378  symbol.changeName(NewPoolTString(buf));
379 
380  return insertAnonymousMembers(symbol, 0);
381  } else {
382  // Check for redefinition errors:
383  // - STL itself will tell us if there is a direct name collision, with name mangling, at this level
384  // - additionally, check for function-redefining-variable name collisions
385  const TString& insertName = symbol.getMangledName();
386  if (symbol.getAsFunction()) {
387  // make sure there isn't a variable of this name
388  if (! separateNameSpaces && level.find(name) != level.end())
389  return false;
390 
391  // insert, and whatever happens is okay
392  level.insert(tLevelPair(insertName, &symbol));
393 
394  return true;
395  } else
396  return level.insert(tLevelPair(insertName, &symbol)).second;
397  }
398  }
399 
400  // Add more members to an already inserted aggregate object
401  bool amend(TSymbol& symbol, int firstNewMember)
402  {
403  // See insert() for comments on basic explanation of insert.
404  // This operates similarly, but more simply.
405  // Only supporting amend of anonymous blocks so far.
406  if (IsAnonymous(symbol.getName()))
407  return insertAnonymousMembers(symbol, firstNewMember);
408  else
409  return false;
410  }
411 
412  bool insertAnonymousMembers(TSymbol& symbol, int firstMember)
413  {
414  const TTypeList& types = *symbol.getAsVariable()->getType().getStruct();
415  for (unsigned int m = firstMember; m < types.size(); ++m) {
416  TAnonMember* member = new TAnonMember(&types[m].type->getFieldName(), m, *symbol.getAsVariable(), symbol.getAsVariable()->getAnonId());
417  if (! level.insert(tLevelPair(member->getMangledName(), member)).second)
418  return false;
419  }
420 
421  return true;
422  }
423 
424  TSymbol* find(const TString& name) const
425  {
426  tLevel::const_iterator it = level.find(name);
427  if (it == level.end())
428  return 0;
429  else
430  return (*it).second;
431  }
432 
434  {
435  size_t parenAt = name.find_first_of('(');
436  TString base(name, 0, parenAt + 1);
437 
438  tLevel::const_iterator begin = level.lower_bound(base);
439  base[parenAt] = ')'; // assume ')' is lexically after '('
440  tLevel::const_iterator end = level.upper_bound(base);
441  for (tLevel::const_iterator it = begin; it != end; ++it)
442  list.push_back(it->second->getAsFunction());
443  }
444 
445  // See if there is already a function in the table having the given non-function-style name.
446  bool hasFunctionName(const TString& name) const
447  {
448  tLevel::const_iterator candidate = level.lower_bound(name);
449  if (candidate != level.end()) {
450  const TString& candidateName = (*candidate).first;
451  TString::size_type parenAt = candidateName.find_first_of('(');
452  if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0)
453 
454  return true;
455  }
456 
457  return false;
458  }
459 
460  // See if there is a variable at this level having the given non-function-style name.
461  // Return true if name is found, and set variable to true if the name was a variable.
462  bool findFunctionVariableName(const TString& name, bool& variable) const
463  {
464  tLevel::const_iterator candidate = level.lower_bound(name);
465  if (candidate != level.end()) {
466  const TString& candidateName = (*candidate).first;
467  TString::size_type parenAt = candidateName.find_first_of('(');
468  if (parenAt == candidateName.npos) {
469  // not a mangled name
470  if (candidateName == name) {
471  // found a variable name match
472  variable = true;
473  return true;
474  }
475  } else {
476  // a mangled name
477  if (candidateName.compare(0, parenAt, name) == 0) {
478  // found a function name match
479  variable = false;
480  return true;
481  }
482  }
483  }
484 
485  return false;
486  }
487 
488  // Use this to do a lazy 'push' of precision defaults the first time
489  // a precision statement is seen in a new scope. Leave it at 0 for
490  // when no push was needed. Thus, it is not the current defaults,
491  // it is what to restore the defaults to when popping a level.
493  {
494  // can call multiple times at one scope, will only latch on first call,
495  // as we're tracking the previous scope's values, not the current values
496  if (defaultPrecision != 0)
497  return;
498 
500  for (int t = 0; t < EbtNumTypes; ++t)
501  defaultPrecision[t] = p[t];
502  }
503 
505  {
506  // can be called for table level pops that didn't set the
507  // defaults
508  if (defaultPrecision == 0 || p == 0)
509  return;
510 
511  for (int t = 0; t < EbtNumTypes; ++t)
512  p[t] = defaultPrecision[t];
513  }
514 
515  void relateToOperator(const char* name, TOperator op);
516  void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
517  void dump(TInfoSink &infoSink) const;
518  TSymbolTableLevel* clone() const;
519  void readOnly();
520 
521  void setThisLevel() { thisLevel = true; }
522  bool isThisLevel() const { return thisLevel; }
523 
524 protected:
527 
528  typedef std::map<TString, TSymbol*, std::less<TString>, pool_allocator<std::pair<const TString, TSymbol*> > > tLevel;
529  typedef const tLevel::value_type tLevelPair;
530  typedef std::pair<tLevel::iterator, bool> tInsertResult;
531 
532  tLevel level; // named mappings
534  int anonId;
535  bool thisLevel; // True if this level of the symbol table is a structure scope containing member function
536  // that are supposed to see anonymous access to member variables.
537 };
538 
540 public:
542  {
543  //
544  // This symbol table cannot be used until push() is called.
545  //
546  }
548  {
549  // this can be called explicitly; safest to code it so it can be called multiple times
550 
551  // don't deallocate levels passed in from elsewhere
552  while (table.size() > adoptedLevels)
553  pop(0);
554  }
555 
556  void adoptLevels(TSymbolTable& symTable)
557  {
558  for (unsigned int level = 0; level < symTable.table.size(); ++level) {
559  table.push_back(symTable.table[level]);
560  ++adoptedLevels;
561  }
562  uniqueId = symTable.uniqueId;
565  }
566 
567  //
568  // While level adopting is generic, the methods below enact a the following
569  // convention for levels:
570  // 0: common built-ins shared across all stages, all compiles, only one copy for all symbol tables
571  // 1: per-stage built-ins, shared across all compiles, but a different copy per stage
572  // 2: built-ins specific to a compile, like resources that are context-dependent, or redeclared built-ins
573  // 3: user-shader globals
574  //
575 protected:
576  static const int globalLevel = 3;
577  bool isSharedLevel(int level) { return level <= 1; } // exclude all per-compile levels
578  bool isBuiltInLevel(int level) { return level <= 2; } // exclude user globals
579  bool isGlobalLevel(int level) { return level <= globalLevel; } // include user globals
580 public:
581  bool isEmpty() { return table.size() == 0; }
584 
587 
588  void push()
589  {
590  table.push_back(new TSymbolTableLevel);
591  }
592 
593  // Make a new symbol-table level to represent the scope introduced by a structure
594  // containing member functions, such that the member functions can find anonymous
595  // references to member variables.
596  //
597  // 'thisSymbol' should have a name of "" to trigger anonymous structure-member
598  // symbol finds.
599  void pushThis(TSymbol& thisSymbol)
600  {
601  assert(thisSymbol.getName().size() == 0);
602  table.push_back(new TSymbolTableLevel);
603  table.back()->setThisLevel();
604  insert(thisSymbol);
605  }
606 
608  {
609  table[currentLevel()]->getPreviousDefaultPrecisions(p);
610  delete table.back();
611  table.pop_back();
612  }
613 
614  //
615  // Insert a visible symbol into the symbol table so it can
616  // be found later by name.
617  //
618  // Returns false if the was a name collision.
619  //
620  bool insert(TSymbol& symbol)
621  {
622  symbol.setUniqueId(++uniqueId);
623 
624  // make sure there isn't a function of this variable name
625  if (! separateNameSpaces && ! symbol.getAsFunction() && table[currentLevel()]->hasFunctionName(symbol.getName()))
626  return false;
627 
628  // check for not overloading or redefining a built-in function
630  if (atGlobalLevel() && currentLevel() > 0) {
631  if (table[0]->hasFunctionName(symbol.getName()))
632  return false;
633  if (currentLevel() > 1 && table[1]->hasFunctionName(symbol.getName()))
634  return false;
635  }
636  }
637 
638  return table[currentLevel()]->insert(symbol, separateNameSpaces);
639  }
640 
641  // Add more members to an already inserted aggregate object
642  bool amend(TSymbol& symbol, int firstNewMember)
643  {
644  // See insert() for comments on basic explanation of insert.
645  // This operates similarly, but more simply.
646  return table[currentLevel()]->amend(symbol, firstNewMember);
647  }
648 
649  //
650  // To allocate an internal temporary, which will need to be uniquely
651  // identified by the consumer of the AST, but never need to
652  // found by doing a symbol table search by name, hence allowed an
653  // arbitrary name in the symbol with no worry of collision.
654  //
656  {
657  symbol.setUniqueId(++uniqueId);
658  }
659 
660  //
661  // Copy a variable or anonymous member's structure from a shared level so that
662  // it can be added (soon after return) to the symbol table where it can be
663  // modified without impacting other users of the shared table.
664  //
666  {
667  if (shared->getAsVariable()) {
668  TSymbol* copy = shared->clone();
669  copy->setUniqueId(shared->getUniqueId());
670  return copy;
671  } else {
672  const TAnonMember* anon = shared->getAsAnonMember();
673  assert(anon);
674  TVariable* container = anon->getAnonContainer().clone();
675  container->changeName(NewPoolTString(""));
676  container->setUniqueId(anon->getAnonContainer().getUniqueId());
677  return container;
678  }
679  }
680 
682  {
683  TSymbol* copy = copyUpDeferredInsert(shared);
684  table[globalLevel]->insert(*copy, separateNameSpaces);
685  if (shared->getAsVariable())
686  return copy;
687  else {
688  // return the copy of the anonymous member
689  return table[globalLevel]->find(shared->getName());
690  }
691  }
692 
693  // Normal find of a symbol, that can optionally say whether the symbol was found
694  // at a built-in level or the current top-scope level.
695  TSymbol* find(const TString& name, bool* builtIn = 0, bool* currentScope = 0, int* thisDepthP = 0)
696  {
697  int level = currentLevel();
698  TSymbol* symbol;
699  int thisDepth = 0;
700  do {
701  if (table[level]->isThisLevel())
702  ++thisDepth;
703  symbol = table[level]->find(name);
704  --level;
705  } while (symbol == nullptr && level >= 0);
706  level++;
707  if (builtIn)
708  *builtIn = isBuiltInLevel(level);
709  if (currentScope)
710  *currentScope = isGlobalLevel(currentLevel()) || level == currentLevel(); // consider shared levels as "current scope" WRT user globals
711  if (thisDepthP != nullptr) {
712  if (! table[level]->isThisLevel())
713  thisDepth = 0;
714  *thisDepthP = thisDepth;
715  }
716 
717  return symbol;
718  }
719 
720  // Find of a symbol that returns how many layers deep of nested
721  // structures-with-member-functions ('this' scopes) deep the symbol was
722  // found in.
723  TSymbol* find(const TString& name, int& thisDepth)
724  {
725  int level = currentLevel();
726  TSymbol* symbol;
727  thisDepth = 0;
728  do {
729  if (table[level]->isThisLevel())
730  ++thisDepth;
731  symbol = table[level]->find(name);
732  --level;
733  } while (symbol == 0 && level >= 0);
734 
735  if (! table[level + 1]->isThisLevel())
736  thisDepth = 0;
737 
738  return symbol;
739  }
740 
742  {
743  if (separateNameSpaces)
744  return false;
745 
746  int level = currentLevel();
747  do {
748  bool variable;
749  bool found = table[level]->findFunctionVariableName(name, variable);
750  if (found)
751  return variable;
752  --level;
753  } while (level >= 0);
754 
755  return false;
756  }
757 
758  void findFunctionNameList(const TString& name, TVector<const TFunction*>& list, bool& builtIn)
759  {
760  // For user levels, return the set found in the first scope with a match
761  builtIn = false;
762  int level = currentLevel();
763  do {
764  table[level]->findFunctionNameList(name, list);
765  --level;
766  } while (list.empty() && level >= globalLevel);
767 
768  if (! list.empty())
769  return;
770 
771  // Gather across all built-in levels; they don't hide each other
772  builtIn = true;
773  do {
774  table[level]->findFunctionNameList(name, list);
775  --level;
776  } while (level >= 0);
777  }
778 
779  void relateToOperator(const char* name, TOperator op)
780  {
781  for (unsigned int level = 0; level < table.size(); ++level)
783  }
784 
785  void setFunctionExtensions(const char* name, int num, const char* const extensions[])
786  {
787  for (unsigned int level = 0; level < table.size(); ++level)
788  table[level]->setFunctionExtensions(name, num, extensions);
789  }
790 
791  void setVariableExtensions(const char* name, int num, const char* const extensions[])
792  {
793  TSymbol* symbol = find(TString(name));
794  if (symbol)
795  symbol->setExtensions(num, extensions);
796  }
797 
798  int getMaxSymbolId() { return uniqueId; }
799  void dump(TInfoSink &infoSink) const;
800  void copyTable(const TSymbolTable& copyOf);
801 
802  void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }
803 
804  void readOnly()
805  {
806  for (unsigned int level = 0; level < table.size(); ++level)
807  table[level]->readOnly();
808  }
809 
810 protected:
813 
814  int currentLevel() const { return static_cast<int>(table.size()) - 1; }
815 
816  std::vector<TSymbolTableLevel*> table;
817  int uniqueId; // for unique identification in code generation
820  unsigned int adoptedLevels;
821 };
822 
823 } // end namespace glslang
824 
825 #endif // _SYMBOL_TABLE_INCLUDED_
Definition: SymbolTable.h:197
GLenum GLenum variable
Definition: glext.h:9938
int numExtensions
Definition: SymbolTable.h:131
virtual const TType & getType() const
Definition: SymbolTable.h:163
bool insertAnonymousMembers(TSymbol &symbol, int firstMember)
Definition: SymbolTable.h:412
void setPreviousDefaultPrecisions(const TPrecisionQualifier *p)
Definition: SymbolTable.h:492
const TTypeList * getStruct() const
Definition: Types.h:1777
void relateToOperator(const char *name, TOperator op)
Definition: SymbolTable.h:779
GLuint const GLchar * name
Definition: glext.h:6671
virtual void dump(TInfoSink &infoSink) const =0
TOperator
Definition: intermediate.h:66
const char ** extensions
Definition: SymbolTable.h:132
static const int globalLevel
Definition: SymbolTable.h:576
#define const
Definition: zconf.h:217
void makeInternalVariable(TSymbol &symbol)
Definition: SymbolTable.h:655
set set set set set set set macro pixldst1 op
Definition: pixman-arm-neon-asm.h:54
void dump(TInfoSink &infoSink) const
Definition: SymbolTable.cpp:199
Definition: InfoSink.h:138
virtual bool isReadOnly() const
Definition: SymbolTable.h:119
GLsizei GLenum GLenum * types
Definition: glext.h:8420
Definition: SymbolTable.h:325
virtual const TType & getType() const =0
Definition: SymbolTable.h:151
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
TSymbol(const TString *n)
Definition: SymbolTable.h:84
void adoptLevels(TSymbolTable &symTable)
Definition: SymbolTable.h:556
void relateToOperator(const char *name, TOperator op)
Definition: SymbolTable.cpp:231
virtual TType & getWritableType()=0
~TSymbolTableLevel()
Definition: SymbolTable.cpp:219
GLdouble GLdouble t
Definition: glext.h:6398
virtual void dump(TInfoSink &infoSink) const
Definition: SymbolTable.cpp:173
bool thisLevel
Definition: SymbolTable.h:535
void pop(TPrecisionQualifier *p)
Definition: SymbolTable.h:607
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:6296
unsigned int uniqueId
Definition: SymbolTable.h:127
TConstUnionArray constArray
Definition: SymbolTable.h:188
void setPreviousDefaultPrecisions(TPrecisionQualifier *p)
Definition: SymbolTable.h:802
GLenum GLuint id
Definition: glext.h:6233
TString * NewPoolTString(const char *s)
Definition: Common.h:156
bool insert(TSymbol &symbol, bool separateNameSpaces)
Definition: SymbolTable.h:366
TBuiltInVariable getDeclaredBuiltIn() const
Definition: SymbolTable.h:210
unsigned int memberNumber
Definition: SymbolTable.h:356
virtual int getAnonId() const
Definition: SymbolTable.h:348
Definition: SymbolTable.h:539
int currentLevel() const
Definition: SymbolTable.h:814
void copyParam(const TParameter &param)
Definition: SymbolTable.h:201
Definition: PoolAlloc.h:264
TBuiltInVariable
Definition: BaseTypes.h:135
int anonId
Definition: SymbolTable.h:357
Definition: SymbolTable.h:216
bool insert(TSymbol &symbol)
Definition: SymbolTable.h:620
bool isGlobalLevel(int level)
Definition: SymbolTable.h:579
virtual TType & getWritableType()
Definition: SymbolTable.h:164
void push()
Definition: SymbolTable.h:588
const TString * name
Definition: SymbolTable.h:126
virtual void makeReadOnly()
Definition: SymbolTable.h:120
bool hasFunctionName(const TString &name) const
Definition: SymbolTable.h:446
T * NewPoolObject(T *)
Definition: Common.h:162
TSymbolTableLevel & operator=(TSymbolTableLevel &)
GLuint GLuint num
Definition: glext.h:10525
bool isSharedLevel(int level)
Definition: SymbolTable.h:577
virtual void setExtensions(int num, const char *const exts[])
Definition: SymbolTable.h:106
const TVariable & anonContainer
Definition: SymbolTable.h:355
TIntermTyped * defaultValue
Definition: SymbolTable.h:200
const tLevel::value_type tLevelPair
Definition: SymbolTable.h:529
TPoolAllocator & GetThreadPoolAllocator()
Definition: PoolAlloc.cpp:47
GLfloat param
Definition: glext.h:6480
GLenum type
Definition: glext.h:6233
void dump(TInfoSink &infoSink) const
Definition: SymbolTable.cpp:192
bool isBuiltInLevel(int level)
Definition: SymbolTable.h:578
Definition: Types.h:1169
bool separateNameSpaces
Definition: SymbolTable.h:819
int anonId
Definition: SymbolTable.h:190
TSymbol * copyUp(TSymbol *shared)
Definition: SymbolTable.h:681
bool IsAnonymous(const TString &name)
Definition: Types.h:54
void findFunctionNameList(const TString &name, TVector< const TFunction *> &list, bool &builtIn)
Definition: SymbolTable.h:758
virtual TSymbol * clone() const =0
TAnonMember & operator=(const TAnonMember &)
void getPreviousDefaultPrecisions(TPrecisionQualifier *p)
Definition: SymbolTable.h:504
virtual TVariable * getAsVariable()
Definition: SymbolTable.h:99
#define POOL_ALLOCATOR_NEW_DELETE(A)
Definition: Common.h:112
GLint level
Definition: glext.h:6293
TSymbol * copyUpDeferredInsert(TSymbol *shared)
Definition: SymbolTable.h:665
const char *const AnonymousPrefix
Definition: Types.h:53
void findFunctionNameList(const TString &name, TVector< const TFunction *> &list)
Definition: SymbolTable.h:433
virtual int getAnonId() const
Definition: SymbolTable.h:172
void setSeparateNameSpaces()
Definition: SymbolTable.h:586
bool amend(TSymbol &symbol, int firstNewMember)
Definition: SymbolTable.h:401
TSymbolTable()
Definition: SymbolTable.h:541
TIntermTyped * constSubtree
Definition: SymbolTable.h:189
TSymbolTableLevel()
Definition: SymbolTable.h:363
std::vector< TSymbolTableLevel * > table
Definition: SymbolTable.h:816
virtual unsigned int getMemberNumber() const
Definition: SymbolTable.h:333
TSymbol * find(const TString &name, int &thisDepth)
Definition: SymbolTable.h:723
virtual bool isUserType() const
Definition: SymbolTable.h:165
virtual const TVariable & getAnonContainer() const
Definition: SymbolTable.h:332
void readOnly()
Definition: SymbolTable.h:804
TPrecisionQualifier * defaultPrecision
Definition: SymbolTable.h:533
virtual TVariable * getAsVariable()
Definition: SymbolTable.h:161
TType type
Definition: SymbolTable.h:180
virtual TAnonMember * clone() const
Definition: SymbolTable.cpp:337
virtual const TType & getType() const
Definition: SymbolTable.h:335
virtual TFunction * getAsFunction()
Definition: SymbolTable.h:97
未知的編譯器 設備已從連接口上移開 文件已存在。儲存到備份至緩衝區 連接來自: 公開地址 設定光碟機裡光碟 你已離開遊戲 這個核心模擬器不支援不同系統的網路連線對打 輸入連線遊戲服務器的密碼: s 已斷開連線 已離開連線遊戲模式 連線遊戲人數已滿 連線遊戲對方 s 已暫停 使用模擬器硬體渲染私人內容時可避免硬體在各frames時的狀態改變 調整選單顯示的相關設定。 以延遲和視訊撕裂為代價換取高性能,當且僅當能 n 達到全速模擬時使用。 自動偵測 容量 連接到連接口 對不起,錯誤發生:模擬器核心未請求內容,無法加入連線遊戲。 密碼 用戶名 帳戶列表終端 成就列表 添加遊戲內容 導入遊戲內容 詢問 塊幀 聲音驅動程式 啟用聲音 渦輪 盲區 聲音最大採樣間隔 動態聲音碼率控制間隔 聲音 SaveRAM自動儲存間隔 自動戴入重映射文件 返回 訊息 向下滾動 開始 切換選單 確認 退出 默認值 切換選單 啟用藍牙服務 緩沖目錄 相機驅動程式 執行金手指修改 金手指文件 另存金手指文件 描述 鎖定 非官方測試成就 未鎖定 設定 設定 退出時進行詢問 遊戲內容數據庫目錄 歷史記錄數量 快捷選單 下載目錄 核心計數器 核心訊息 分類 核心名稱 許可證 支持的擴展 系統名稱 戴入核心 核心 自動解壓下載的檔案 核心更新程序 指針目錄 自定義比率 選擇數據庫 選擇文件並探測核心< 默認 > 沒有找到文件夾。 Disk Cycle Tray Status 光碟索引 不關心 下載核心…… 啟用DPI覆蓋 驅動 載入前檢查韌體 BIOS是否存在 動態壁紙目錄 選單項懸停顏色 取消 顯示幀率 幀率限制 自動戴入遊戲內容特定的核心選項 遊戲選項文件 聲音 視訊故障排除 基本選單控制 戴入遊戲內容 什麼是「核心」? 歷史 圖像 訊息 所有用戶都能控制選單 左搖桿Y 右搖桿X 右搖桿Y Gun Trigger Gun Aux A Gun Aux C Gun Select Gun D pad Down Gun D pad Right 輸入軸閾值 綁定全部 綁定超時時間 顯示輸入描述標籤 設備類型 Turbo占空比 鍵盤控制器映射啟用 下十字鍵 左十字鍵 右十字鍵 開始鍵 Mouse Mouse Mouse Wheel Down Wheel Right 最大用戶數 金手指索引 金手指開關 下一張光碟 啟用熱鍵 快進切換 切換全營幕 切換遊戲焦距 切換選單 靜音開關 切換營幕鍵盤 切換暫停 重置遊戲 儲存狀態 下一個Shader 慢動作 存檔槽 音量 顯示覆層 輪詢類型行為 稍晚 優先前置觸摸 啟用綁定重映射 輸入 啟用觸摸 Turbo區間 內部存儲狀態 手柄驅動 簡體中文 荷蘭語 世界語 德語 日語 波蘭語 葡萄牙語 西班牙語 Arabic 核心目錄 核心日誌級別 使用核心戴入壓縮包 載入遊戲內容 允許使用位置 日誌 主選單 選單顏色主題 藍灰色 綠色 紅色 底部不透明度 選單驅動 選單文件瀏覽器 Horizontal Animation 選單壁紙 丟失 鼠標支持 音樂 環繞式導航 連線遊戲 連線遊戲延遲幀數 啟用連線遊戲 作為遊戲主機 服務器地址 啟用連線遊戲客戶端 服務器密碼 連線遊戲無狀態模式 啟用連線遊戲旁觀者 連線遊戲使用NAT穿透技術 網路命令端口 網路遊戲控制器 網路 無 沒有可顯示的成就。 沒有可用的核心。 沒有可用的核心選項。 沒有可用的歷史記錄。 沒有條目。 未發現網路。 沒有遊戲列表。 沒有找到設定。 關 連線更新器 營幕覆層 營幕通知 OSK覆層目錄 自動戴入最佳的覆層 覆層不透明度 覆層縮放比例 使用PAL60模式 當選單激活時暫停 性能計數器 遊戲列表目錄 觸控支援 現在 退出 RetroArch BBFC 分級 多人遊戲支持 描述 Edge雜誌發行 Edge雜誌評論 增強硬件 經銷商 MD5 起源 出版方 發售年份 系列 啟動遊戲內容 重啟 錄影輸出目錄 錄影設定 啟用錄影 使用輸出目錄 戴入重映射文件 儲存遊戲重映射文件 重啟 繼續 Retro鍵盤 RetroPad w Analog 啟用回溯 回溯 設定目錄 右側搖桿 啟用SAMBA文件共享服務 自動索引儲存狀態 自動儲存狀態 既時存檔縮圖 儲存核心覆寫 儲存新設定 存檔 掃瞄文件 營幕截圖目錄 搜索: 設定 Shader Shader效果 Simple Snow 顯示高級設定 關機 排序文件夾中的存檔 啟用SSH遠程終端服務 啟動遠程的RetroPad 狀態存儲槽 標準輸入流命令 暫停屏保程序 系統 BIOS目錄 支持 編譯日期 Cocoa 支持 CoreText 支持 顯示器度量DPI DirectSound 支持 動態鏈接庫支持 EGL 支持 FFmpeg 支持 STB TrueType 支持 前端名稱 Git版本 HLSL 支持 KMS EGL 支持 Libusb 支持 網路控制台支持 OpenAL 支持 OpenGL 支持 OpenVG 支持 覆層支持 已充滿電 放電中 PulseAudio 支持 BMP RetroRating 等級 RoarAudio 支持 RSound 支持 SDL2 支持 SDL1 支持 多線程支持 Video4Linux2 支持 Vulkan 支持 X11 支持 XVideo 支持 截取營幕 縮略圖 縮略圖更新程序 截屏 顯示時間日期 真 UI Companion Start On Boot 無法讀取壓縮的文件。 撤銷儲存狀態 更新程序 更新自動設定檔案 更新金手指 更新數據庫 更新 Lakka 更新Slang Shader效果文件 用戶界面 用戶 使用內建媒體播放器 允許旋轉 畫面比例選項 Crop 禁用桌面元素 視訊驅動 視訊濾鏡目錄 強制畫面比例 幀延時 視訊Gamma 啟用GPU截屏 強制GPU同步幀數 顯示器索引 刷新率 Set Display Reported Refresh Rate 窗口縮放量 視訊 Shader渲染遍數 戴入Shader預設 儲存核心預設 啟用硬件共享上下文 啟用軟件過濾器 視訊 降低閃爍 自定義畫面寬度 自定義畫面Y 垂直同步 窗口寬度 Wi Fi驅動 選單透明度因子 自定義 Monochrome Systematic Pixel Retrosystem 選單顏色主題 深色 鐵藍色 傳統紅 樸素 火山紅 選單縮放因子 顯示歷史頁 顯示圖像頁 顯示設定頁 Menu Layout 是 打開或關閉成就。更多內容請訪問 為測試目的而打開或關閉非官方成就和 或測試版特性。 修改驅動設定。 修改核心設定。 修改顯示覆蓋、鍵盤覆蓋和營幕通知的設定。 修改存檔設定。 修改用戶界面設定。 修改你的隱私設定。 修改遊戲列表設定。 下載且 或者掃瞄遊戲內容,並將其加入你的收藏中。 啟用或者禁止藍牙。 修改設定文件的默認設定。 CPU擁有的核心總數。 設定熱鍵選項。 調整遊戲控制器、鍵盤和鼠標的設定。 啟用或禁止向控制台打印日誌。 在局域網內搜索並連接聯網遊戲的主機。 下載並更新RetroArch的附加插件和組件。 管理操作系統層級的服務。 阻止系統激活營幕保護程序。 在幀與幀之間插入黑色的中間幀,通常用於消除在 n n 的鬼影。 設定當開啟「強制GPU同步」時CPU可以預先GPU多少幀。 選擇將要使用哪一個顯示器。 The refresh rate as reported by the display driver 掃瞄無線網路並且建立連接。 磁碟已加入 載入 shader 取消靜音。 自動設定文件儲存成功。 自動儲存狀態至 啟用通訊埠上的指令介面 無法推斷新的設定路徑,使用當前時間。 與已知的magic numbers比較 未設定設定目錄,無法儲存新的設定。 內容的CRC32s不同。無法使用不同的遊戲。 核心不支持儲存狀態。 無法找到磁碟 無法找到有效的數據軌 無法讀取內容文件 無法讀取視訊狀態 Custom timing given 解壓縮失敗。 無法找到任何有效的內容位置 已關閉 正在下載 錯誤 Libretro core 但程式未找到可載入內容 無法儲存 core options 檔案 無法儲存預置 shader 正在解壓 無法儲存設定到 無法讓觀眾加入 無法載入 shader 創建目錄失敗。 從客戶端獲取暱稱失敗 載入內容失敗 無法戴入 overlay 打開libretro核心失敗 無法接收連線端的資訊 無法接收主控端的暱稱 無法接收主控端 SRAM 資料 移除臨時文件失敗 即時存檔儲存失敗 發送暱稱尺寸失敗 發送暱稱至主控端失敗 聲音驅動啟動失敗,將在無聲音模式下繼續啟動。 建用錄製視訊失敗 還原載入即時存檔失敗 還原取消靜音失敗 未找到文件 找到磁碟標籤 找到最後一個狀態槽 幀 錯誤的磁碟索引 打開遊戲焦點 Libretro core is hardware rendered Must use post shaded recording as well 輸入金手指 目前檔案 接口 可移除的儲存空間 字節 兆字節 為libretro而設計的前端 戴入狀態從槽 一個或多個固件文件丟失 正在讀取歷史文件 內存 視訊格式看起來使用了不同的序列化版本。很有可能失敗。 停止視訊錄製。 沒有內容,啟動虛擬核心。 沒有戴入任何存檔。 覆蓋儲存成功。 RetroArch 接收完畢 錄製到 重新轉向 save file to Remap file 儲存成功 移除臨時內容文件 重啟錄製由於驅動器重新初始化。 Reverting savefile directory to 正在回溯。 初始化回放緩存失敗 回放功能關閉 到達回放緩存末端 儲存狀態至槽 成功儲存至 存檔中 已完成對文件夾的掃瞄 Several patches are explicitly defined
Definition: msg_hash_cht.h:2214
virtual const TVariable * getAsVariable() const
Definition: SymbolTable.h:162
virtual TIntermTyped * getConstSubtree() const
Definition: SymbolTable.h:170
GLfloat GLfloat p
Definition: glext.h:9809
virtual TType & getWritableType()
Definition: SymbolTable.h:341
void setFunctionExtensions(const char *name, int num, const char *const extensions[])
Definition: SymbolTable.cpp:248
virtual const TAnonMember * getAsAnonMember() const
Definition: SymbolTable.h:101
void setFunctionExtensions(const char *name, int num, const char *const extensions[])
Definition: SymbolTable.h:785
Definition: arrays.h:46
void readOnly()
Definition: SymbolTable.cpp:266
TSymbol & operator=(const TSymbol &)
TVariable & operator=(const TVariable &)
TVariable(const TString *name, const TType &t, bool uT=false)
Definition: SymbolTable.h:153
bool writable
Definition: SymbolTable.h:138
virtual TQualifier & getQualifier()
Definition: Types.h:1345
bool isThisLevel() const
Definition: SymbolTable.h:522
virtual ~TAnonMember()
Definition: SymbolTable.h:329
bool amend(TSymbol &symbol, int firstNewMember)
Definition: SymbolTable.h:642
bool findFunctionVariableName(const TString &name, bool &variable) const
Definition: SymbolTable.h:462
void copyTable(const TSymbolTable &copyOf)
Definition: SymbolTable.cpp:374
virtual void setAnonId(int i)
Definition: SymbolTable.h:171
Definition: SymbolTable.h:81
TSymbol * find(const TString &name, bool *builtIn=0, bool *currentScope=0, int *thisDepthP=0)
Definition: SymbolTable.h:695
TAnonMember(const TString *n, unsigned int m, const TVariable &a, int an)
Definition: SymbolTable.h:327
~TSymbolTable()
Definition: SymbolTable.h:547
void pushThis(TSymbol &thisSymbol)
Definition: SymbolTable.h:599
Definition: intermediate.h:67
tLevel level
Definition: SymbolTable.h:532
int anonId
Definition: SymbolTable.h:534
TPrecisionQualifier
Definition: BaseTypes.h:375
std::basic_string< char, std::char_traits< char >, TStringAllocator > TString
Definition: Common.h:128
TFunction(TOperator o)
Definition: SymbolTable.h:218
bool atGlobalLevel()
Definition: SymbolTable.h:583
int uniqueId
Definition: SymbolTable.h:817
bool isFunctionNameVariable(const TString &name) const
Definition: SymbolTable.h:741
virtual TConstUnionArray & getWritableConstArray()
Definition: SymbolTable.h:167
std::map< TString, TSymbol *, std::less< TString >, pool_allocator< std::pair< const TString, TSymbol * > > > tLevel
Definition: SymbolTable.h:528
TSymbolTable & operator=(TSymbolTableLevel &)
Definition: ConstantUnion.h:874
Definition: SymbolTable.h:360
void setNoBuiltInRedeclarations()
Definition: SymbolTable.h:585
virtual const char ** getExtensions() const
Definition: SymbolTable.h:116
void setThisLevel()
Definition: SymbolTable.h:521
TBuiltInVariable builtIn
Definition: Types.h:487
bool noBuiltInRedeclarations
Definition: SymbolTable.h:818
GLuint GLuint end
Definition: glext.h:6292
bool isEmpty()
Definition: SymbolTable.h:581
int getMaxSymbolId()
Definition: SymbolTable.h:798
#define false
Definition: ordinals.h:83
virtual const TString & getName() const
Definition: SymbolTable.h:88
virtual void addPrefix(const char *prefix)
Definition: SymbolTable.h:90
virtual ~TVariable()
Definition: SymbolTable.h:159
bool userType
Definition: SymbolTable.h:181
virtual void changeName(const TString *newName)
Definition: SymbolTable.h:89
TSymbol * find(const TString &name) const
Definition: SymbolTable.h:424
#define true
Definition: ordinals.h:82
void setVariableExtensions(const char *name, int num, const char *const extensions[])
Definition: SymbolTable.h:791
virtual TVariable * clone() const
Definition: SymbolTable.cpp:301
std::pair< tLevel::iterator, bool > tInsertResult
Definition: SymbolTable.h:530
Definition: Common.h:175
virtual void setConstSubtree(TIntermTyped *subtree)
Definition: SymbolTable.h:169
TString * name
Definition: SymbolTable.h:198
Definition: intermediate.h:1042
virtual void dump(TInfoSink &infoSink) const
Definition: SymbolTable.cpp:187
virtual void setUniqueId(int id)
Definition: SymbolTable.h:104
virtual void setConstArray(const TConstUnionArray &array)
Definition: SymbolTable.h:168
virtual int getNumExtensions() const
Definition: SymbolTable.h:115
virtual int getUniqueId() const
Definition: SymbolTable.h:105
GLdouble n
Definition: glext.h:8396
virtual const TConstUnionArray & getConstArray() const
Definition: SymbolTable.h:166
const GLfloat * m
Definition: glext.h:11755
virtual const TVariable * getAsVariable() const
Definition: SymbolTable.h:100
virtual ~TSymbol()
Definition: SymbolTable.h:86
virtual const TFunction * getAsFunction() const
Definition: SymbolTable.h:98
Definition: lobject.h:303
TSymbolTableLevel * clone() const
Definition: SymbolTable.cpp:347
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
virtual const TString & getMangledName() const
Definition: SymbolTable.h:96
TType * type
Definition: SymbolTable.h:199
Definition: BaseTypes.h:68
unsigned int adoptedLevels
Definition: SymbolTable.h:820
virtual const TAnonMember * getAsAnonMember() const
Definition: SymbolTable.h:331
bool atBuiltInLevel()
Definition: SymbolTable.h:582