?login_element?

Subversion Repositories NedoOS

Rev

Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  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. bool NeedIoC();
  45. bool isMacroNext();                             // checks if ".macro" directive is ahead (but doesn't consume it)
  46. char* GetID(char*& p);
  47. void ResetGrowSubId();
  48. char* GrowSubId(char* & p);
  49. char* GrowSubIdByExtraChar(char* & p);  // force grow even by non-label char
  50. char* getinstr(char*& p);
  51. bool anyComma(char*& p);                // eats any comma (even one of double-commas)
  52. bool comma(char*& p);                   // eats single comma, but not if double-comma is ahead
  53. bool doubleComma(char* & p);
  54. bool nonMaComma(char* & p);             // eats single comma only if multi-arg is configured to non-comma
  55. bool relaxedMaComma(char* & p); // checks multi-arg comma (double/single), but also eats single comma
  56. EBracketType OpenBracket(char*& p);
  57. int CloseBracket(char*& p);
  58. char* ParenthesesEnd(char* p);
  59. int check8(aint val);
  60. int check8o(aint val);
  61. int check16(aint val);
  62. int check16u(aint val);
  63. int check24(aint val);
  64. void checkLowMemory(byte lowByte, byte hiByte);
  65. int need(char*& p, char c);
  66. int need(char*& p, const char* c);
  67. int needa(char*& p, const char* c1, int r1, const char* c2 = 0, int r2 = 0, const char* c3 = 0, int r3 = 0, bool allowParenthesisEnd = false);
  68. bool GetNumericValue_ProcessLastError(const char* const srcLine);
  69. bool GetNumericValue_TwoBased(char*& p, const char* const pend, aint& val, const int shiftBase);
  70. bool GetNumericValue_IntBased(char*& p, const char* const pend, aint& val, const int base);
  71. int GetConstant(char*& op, aint& val);
  72. int GetCharConst(char*& p, aint& val);
  73. int GetCharConstInDoubleQuotes(char*& op, aint& val);
  74. int GetCharConstInApostrophes(char*& op, aint& val);
  75. template <class strT> int GetCharConstAsString(char* & p, strT e[], int & ei, int max_ei = 128, int add = 0);
  76. int GetBytes(char*& p, int e[], int add, int dc);
  77. void GetStructText(char*& p, aint len, byte* data, const byte* initData = nullptr);     // initData indicate "{}" is required for multi-value init
  78. int GetBits(char*& p, int e[]);
  79. int GetBytesHexaText(char*& p, int e[]);
  80. int cmphstr(char*& p1, const char* p2, bool allowParenthesisEnd = false);               // p2 must be lowercase to match both cases
  81. char* GetFileName(char*& p, bool convertslashes=true);
  82. char* GetOutputFileName(char*& p, bool convertslashes=true);    // prepends the filename with OutPrefix
  83. EDelimiterType GetDelimiterOfLastFileName();    // DT_NONE if no GetFileName was called
  84. bool isLabelStart(const char *p, bool modifiersAllowed = true);
  85. int islabchar(char p);
  86. EStructureMembers GetStructMemberId(char*& p);
  87. EDelimiterType DelimiterBegins(char*& src, const std::array<EDelimiterType, 3> delimiters, bool advanceSrc = true);
  88. EDelimiterType DelimiterAnyBegins(char*& src, bool advanceSrc = true);
  89. int GetMacroArgumentValue(char* & src, char* & dst);
  90.