protected Combinator(Combinator combinator) { _descriptor = combinator._descriptor; _arguments = new KeyValuePair <string, object> [combinator._arguments.Length]; Array.Copy(combinator._arguments, _arguments, combinator._arguments.Length); }
private void Decompile(byte[] raw, ref int offset, string expectedType) { int id = _formatter.ReadInt32(raw, ref offset); _descriptor = _schema.FindCombinator(id); _genericType = VectorType(expectedType); if (IsVector) { int length = _formatter.ReadInt32(raw, ref offset); _values = new object[length]; for (int i = 0; i < length; i++) { _values[i] = Argument(raw, ref offset, _genericType); } } else { ApiSchema.Argument[] args = _schema.FindArguments(Descriptor); _arguments = new KeyValuePair <string, object> [args.Length]; for (int i = 0; i < args.Length; i++) { _arguments[i] = new KeyValuePair <string, object>(args[i].Name, Argument(raw, ref offset, args[i].Type)); } } }
public Combinator(string name, string type, params object[] args) { _descriptor = _schema.FindCombinator(name); _genericType = type; if (IsVector) { _values = args; } else { FillArguments(args); } }
private void Compile(Lexer lexer) { lexer.Next("\\("); string name = lexer.Next("(\\w|\\.)*").Trim(); _descriptor = _schema.FindCombinator(name); ApiSchema.Argument[] args = _schema.FindArguments(Descriptor); _arguments = new KeyValuePair <string, object> [args.Length]; for (int i = 0; i < args.Length; i++) { _arguments[i] = new KeyValuePair <string, object>(args[i].Name, Argument(lexer, args[i].Type)); } lexer.Next(@"\)"); }
public Combinator(string name, params object[] args) { _descriptor = _schema.FindCombinator(name); _genericType = null; FillArguments(args); }