public void AddConSymbol(IdToken idToken, Expr e) { AssertUndefined(idToken); ConSymbolInfo conSymbolInfo = new ConSymbolInfo(idToken, e); AddSymbolInfo(conSymbolInfo); conList.Add(conSymbolInfo); }
static byte Clkmode(ConSymbolInfo csi) { if (csi == null) return 0; int clkmode = csi.Value.IntValue; int b = -1; for (int i = 0; i < 6; ++i) { if ((clkmode & (1 << i)) != 0) { if (b != -1) throw new ParseException("Invalid _CLKMODE", csi.IdToken); b = i; } } byte m = 0; switch (b) { case 0: m = 0x00; break; case 1: m = 0x01; break; case 2: m = 0x02; break; case 3: m = 0x2a; break; case 4: m = 0x32; break; case 5: m = 0x3a; break; } clkmode >>= 6; if (clkmode == 0) return m; m |= 0x60; b = -1; for (int i = 0; i < 5; ++i) { if ((clkmode & (1 << i)) != 0) { if (b != -1) throw new ParseException("Invalid _CLKMODE", csi.IdToken); b = i; } } m += (byte)(b + 1); return m; }
public void AddBuiltInConSymbol(IdToken idToken, Expr e) { AssertUndefined(idToken); ConSymbolInfo conSymbolInfo = new ConSymbolInfo(idToken, e); AddSymbolInfo(conSymbolInfo); }