bool ExpectTerminal(Type t) { if (Expect(t)) { CreateTerminalChild(previous); return(true); } return(false); }
bool Accept(Type t) { if (current.Is(t)) { Debug("Accepted " + t + " Content: " + current.Content); PC++; Debug(PC + ""); return(true); } return(false); }
bool Expect(Type t) { if (Accept(t)) { return(true); } else { Error("Unexpected Token: " + current.Content + " expecting " + t.ToString()); } return(false); }
bool DataTypeSimple() { Type t = current.Type; if (t == Type.Number || t == Type.Boolean || t == Type.Text) { Debug("Is datatype"); return(true); } else { return(false); } }
bool DataType(bool Expect_Sub, out bool IsArray) //, out YSToken TypeToken, out bool IsArray) { Debug("Checking if " + current.Type + " is a datatype"); Type t = current.Type; if (DataTypeSimple()) { PushParseNode(ParseNodeType.DataType); CreateTerminalChild(current); //TypeToken = current; PC++; IsArray = false; PopAndInsertParseNode(); return(true); } else if (t == Type.Array) { PushParseNode(ParseNodeType.DataType); Accept(Type.Array); CreateTerminalChild(previous); Expect(Type.Of); if (!DataTypeSimple()) { Error("Expecting a data type after array of"); } CreateTerminalChild(current); //TypeToken = current; PC++; ArrayDimensions(); IsArray = true; PopAndInsertParseNode(); return(true); } else { if (Expect_Sub) { Error("Expecting a data type"); } Debug("Not a datatype"); //TypeToken = new YSToken (-1, YSToken.TokenType.None, ""); IsArray = false; return(false); } }
public IdentityType TranslateTokenTypeToIdentityType(Type current) { switch (current) { case Type.Number: return(IdentityType.Number); case Type.Text: return(IdentityType.Text); case Type.Boolean: return(IdentityType.Boolean); case Type.Structure: return(IdentityType.Structure); default: return(IdentityType.Unknown); } }
bool ExpectTerminal(Type t) { if (Expect (t)) { CreateTerminalChild (previous); return true; } return false; }
bool Expect(Type t) { if (Accept (t)) { return true; } else { Error("Unexpected Token: " + current.Content + " expecting " + t.ToString()); } return false; }
bool Accept(Type t) { if (current.Is (t)) { Debug ("Accepted " + t + " Content: " + current.Content); PC++; Debug (PC + ""); return true; } return false; }
public IdentityType TranslateTokenTypeToIdentityType(Type current) { switch (current) { case Type.Number: return IdentityType.Number; case Type.Text: return IdentityType.Text; case Type.Boolean: return IdentityType.Boolean; case Type.Structure: return IdentityType.Structure; default: return IdentityType.Unknown; } }