public bool DeclareVariables(VarDeclarationList List, VarDeclConvMode Mode = VarDeclConvMode.Nothing, GetIdMode IdMode = GetIdMode.Everywhere) { var Variables = List.ToVariables(GetPlugin(), BeginEndMode.Both, Mode); return(DeclareVariables(Variables, IdMode)); }
public static VarDeclarationList Create(IdContainer Container, CodeString Code, List <Modifier> DefaultModifiers = null, VarDeclarationListFlags Flags = VarDeclarationListFlags.Default) { var Ret = new VarDeclarationList(DefaultModifiers); var Rec = Container.State.Language.VarDeclRecognizer; if (Rec != null) { var EnableMessages = (Flags & VarDeclarationListFlags.EnableMessages) != 0; if (!Rec.Recognize(Container, Code, EnableMessages, Ret)) { return(null); } if (!Ret.Process(Container, Flags)) { return(null); } } else { throw new ApplicationException("A variable declaration recognizer is not avaiable"); } return(Ret); }
public bool DeclareVariables(CodeString Str, List <Modifier> Mods = null, VarDeclConvMode Mode = VarDeclConvMode.Nothing, GetIdMode IdMode = GetIdMode.Everywhere) { var List = VarDeclarationList.Create(this, Str, Mods); if (List == null) { return(false); } return(DeclareVariables(List, Mode, IdMode)); }
public FunctionParameter[] GetParameters(IdContainer Container, CodeString Parameters) { var DeclList = VarDeclarationList.Create(Container, Parameters); if (DeclList == null) { return(null); } var RetValue = DeclList.ToFuncParams(new PluginForGlobals(Container), Mode: VarDeclConvMode.Normal); if (RetValue == null || RetValue.Contains(null)) { return(null); } return(RetValue); }
static bool SameTypes(VarDeclarationList A, VarDeclarationList B) { if (A.Count != B.Count) { return(false); } for (var i = 0; i < A.Count; i++) { if (!A[i].Type.IsEquivalent(B[i].Type)) { return(false); } } return(true); }