PageRenderTime 52ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 1ms

/System.cs

https://bitbucket.org/cvillamor/compiler
C# | 35 lines | 30 code | 5 blank | 0 comment | 0 complexity | e4623f1640b27a1ce097e53754b396ed MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Compiler_
  6. {
  7. class SystemC
  8. {
  9. private Dictionary<string, Record> m_SystemCalls;
  10. public SystemC()
  11. {
  12. m_SystemCalls = new Dictionary<string, Record>();
  13. CreateSystemFuncs();
  14. CreateSystemProcs();
  15. }
  16. public Dictionary<string, Record> SystemCalls
  17. {
  18. get { return m_SystemCalls; }
  19. }
  20. void CreateSystemFuncs()
  21. {
  22. SystemCalls.Add("abs", new SystemCallRecord("abs", TOKEN_TYPES.TK_SYS_FUNC, 1));
  23. }
  24. void CreateSystemProcs()
  25. {
  26. SystemCalls.Add("write", new SystemCallRecord("write", TOKEN_TYPES.TK_SYS_PROC, 1));
  27. SystemCalls.Add("writeln", new SystemCallRecord("writeln", TOKEN_TYPES.TK_SYS_PROC, 2));
  28. }
  29. }
  30. }