Subversion Repositories NedoOS

Rev

Rev 126 | Rev 539 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

  1. /*
  2.  
  3.   SjASMPlus Z80 Cross Compiler
  4.  
  5.   This is modified sources of SjASM by Aprisobal - aprisobal@tut.by
  6.  
  7.   Copyright (c) 2005 Sjoerd Mastijn
  8.  
  9.   This software is provided 'as-is', without any express or implied warranty.
  10.   In no event will the authors be held liable for any damages arising from the
  11.   use of this software.
  12.  
  13.   Permission is granted to anyone to use this software for any purpose,
  14.   including commercial applications, and to alter it and redistribute it freely,
  15.   subject to the following restrictions:
  16.  
  17.   1. The origin of this software must not be misrepresented; you must not claim
  18.          that you wrote the original software. If you use this software in a product,
  19.          an acknowledgment in the product documentation would be appreciated but is
  20.          not required.
  21.  
  22.   2. Altered source versions must be plainly marked as such, and must not be
  23.          misrepresented as being the original software.
  24.  
  25.   3. This notice may not be removed or altered from any source distribution.
  26.  
  27. */
  28.  
  29. #pragma once
  30.  
  31. #include <array>
  32.  
  33. enum EDelimiterType { DT_NONE, DT_QUOTES, DT_APOSTROPHE, DT_ANGLE, DT_COUNT };
  34. enum EBracketType { BT_NONE, BT_ROUND, BT_CURLY, BT_SQUARE, BT_COUNT };
  35.  
  36. bool White(const char c);
  37. bool White();
  38. void SkipParam(char*&);
  39. int SkipBlanks(char*& p);
  40. int SkipBlanks();
  41. void SkipToEol(char*& p);
  42. int NeedEQU();
  43. int NeedDEFL();
  44. char* GetID(char*& p);
  45. void ResetGrowSubId();
  46. char* GrowSubId(char* & p);
  47. char* GrowSubIdByExtraChar(char* & p);  // force grow even by non-label char
  48. char* getinstr(char*& p);
  49. bool anyComma(char*& p);                // eats any comma (even one of double-commas)
  50. bool comma(char*& p);                   // eats single comma, but not if double-comma is ahead
  51. bool doubleComma(char* & p);
  52. bool doubleBacktick(char* & p);
  53. bool nonMaComma(char* & p);             // eats single comma only if multi-arg is configured to non-comma
  54. EBracketType OpenBracket(char*& p);
  55. int CloseBracket(char*& p);
  56. char* getparen(char* p);
  57. int check8(aint val, bool error=true);
  58. int check8o(long val);
  59. int check16(aint val, bool error=true);
  60. int check24(aint val, bool error=true);
  61. int need(char*& p, char c);
  62. int need(char*& p, const char* c);
  63. int needa(char*& p, const char* c1, int r1, const char* c2 = 0, int r2 = 0, const char* c3 = 0, int r3 = 0);
  64. bool GetNumericValue_ProcessLastError(const char* const srcLine);
  65. bool GetNumericValue_TwoBased(char*& p, const char* const pend, aint& val, const int shiftBase);
  66. bool GetNumericValue_IntBased(char*& p, const char* const pend, aint& val, const int base);
  67. int GetConstant(char*& op, aint& val);
  68. int GetCharConst(char*& p, aint& val);
  69. int GetCharConstInDoubleQuotes(char*& op, aint& val);
  70. int GetCharConstInApostrophes(char*& op, aint& val);
  71. template <class strT> int GetCharConstAsString(char* & p, strT e[], int & ei, int max_ei = 128, int add = 0);
  72. int GetBytes(char*& p, int e[], int add, int dc);
  73. int GetBits(char*& p, int e[]);
  74. int GetBytesHexaText(char*& p, int e[]);
  75. int cmphstr(char*& p1, const char* p2);         // p2 must be lowercase to match both cases
  76. char* GetFileName(char*& p, bool convertslashes=false);
  77. EDelimiterType GetDelimiterOfLastFileName();    // DT_NONE if no GetFileName was called
  78. int islabchar(char p);
  79. EStructureMembers GetStructMemberId(char*& p);
  80. EDelimiterType DelimiterBegins(char*& src, const std::array<EDelimiterType, 3> delimiters, bool advanceSrc = true);
  81. EDelimiterType DelimiterAnyBegins(char*& src, bool advanceSrc = true);
  82. int GetMacroArgumentValue(char* & src, char* & dst);
  83.