1 /* 2 * The contents of this file are subject to the Mozilla Public License 3 * Version 1.0 (the "License"); you may not use this file except in 4 * compliance with the License. You may obtain a copy of the License at 5 * http://www.mozilla.org/MPL/ 6 * 7 * Software distributed under the License is distributed on an "AS IS" 8 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 9 * License for the specific language governing rights and limitations 10 * under the License. 11 * 12 * The Initial Developer of this code is David Baum. 13 * Portions created by David Baum are Copyright (C) 1998 David Baum. 14 * All Rights Reserved. 15 * 16 * Portions created by John Hansen are Copyright (C) 2005 John Hansen. 17 * All Rights Reserved. 18 * 19 */ 20 21 #ifndef __Macro_h 22 #define __Macro_h 23 24 #ifndef __Token_h 25 #include "Token.h" 26 #endif 27 28 #ifndef __PTypes_h 29 #include "PTypes.h" 30 #endif 31 32 class Macro 33 { 34 public: 35 enum { kNoArgs = -1 }; 36 37 Macro(const Token *tokens, int tokenCount, int argCount); 38 ~Macro(); 39 GetTokenCount()40 int GetTokenCount() const { return fTokenCount; } GetTokens()41 const Token* GetTokens() const { return fTokens; } GetArgCount()42 int GetArgCount() const { return fArgCount; } 43 IsMarked()44 bool IsMarked() const { return fMark; } SetMark()45 void SetMark() { fMark = true; } ClearMark()46 void ClearMark() { fMark = false; } 47 48 private: 49 Token* fTokens; 50 int fTokenCount; 51 int fArgCount; 52 bool fMark; 53 }; 54 55 #endif 56