private D_PieceInformation makePieceInformation(PieceTokenizer f) { var g = f.reStart(); D_JustPiece c; D_PieceWithParam d; D_PieceInformation piece = new D_PieceInformation(); if ((c = makeJustPiece(f)) != null) { piece.PieceInformationClause = D_PieceInformation.D_PieceInformationClause.JustPiece; piece.JustPiece = c; } else if ((d = makePieceWithParam(f)) != null) { piece.PieceInformationClause = D_PieceInformation.D_PieceInformationClause.PieceWithParam; piece.PieceWithParam = d; } else { f.goBack(g); return null; } return piece; }
private Tuple<string, string> buildPieceInformation(VariableTracker vt, D_PieceInformation pieceInformation, D_Item item) { StringBuilder cls = new StringBuilder(); StringBuilder method = new StringBuilder(); Tuple<string, string> v; switch (pieceInformation.PieceInformationClause) { case D_PieceInformation.D_PieceInformationClause.JustPiece: v = buildJustPiece(vt, pieceInformation.JustPiece, item); cls.AppendLine(v.Item1); method.AppendLine(v.Item2); break; case D_PieceInformation.D_PieceInformationClause.PieceWithParam: v = buildPieceWithParam(vt, pieceInformation.PieceWithParam, item); cls.AppendLine(v.Item1); method.AppendLine(v.Item2); break; default: throw new ArgumentOutOfRangeException(); } return new Tuple<string, string>(cls.ToString(), method.ToString()); }