/System.cs
https://bitbucket.org/cvillamor/compiler · C# · 35 lines · 30 code · 5 blank · 0 comment · 0 complexity · e4623f1640b27a1ce097e53754b396ed MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Compiler_
- {
- class SystemC
- {
- private Dictionary<string, Record> m_SystemCalls;
- public SystemC()
- {
- m_SystemCalls = new Dictionary<string, Record>();
- CreateSystemFuncs();
- CreateSystemProcs();
- }
- public Dictionary<string, Record> SystemCalls
- {
- get { return m_SystemCalls; }
- }
- void CreateSystemFuncs()
- {
- SystemCalls.Add("abs", new SystemCallRecord("abs", TOKEN_TYPES.TK_SYS_FUNC, 1));
- }
- void CreateSystemProcs()
- {
- SystemCalls.Add("write", new SystemCallRecord("write", TOKEN_TYPES.TK_SYS_PROC, 1));
- SystemCalls.Add("writeln", new SystemCallRecord("writeln", TOKEN_TYPES.TK_SYS_PROC, 2));
- }
- }
- }