, , , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


-

:

: . : 22.06.2012. : 2011. : 13. antiplagiat.ru: < 30%

():


Π ߠ
Š
ɠ ɠҠȠ ȠȻ


ߠ

:


-





:
951002 ..
: ..





2011

:

3
    .
4

4

5

5

6
    -
    7

8

10

11



















PHP 5. .NET.
, , .
:
) PHP 5.
) .
) GraphViz, - . .
- (- main), -.









    .



1 -
, .


2 -



3 -
.



4 -

堫 , .

5 -



    6 -

, .





    -
(. Cyclomatic complexity of a program) ( ) , , . .
. - 1976 ; . .
: , , . , , . -. ; , .











    8 -

    9 -
. 9 . . . , , - . -.

    10 -


[1] ., , : /.. , 2009 .
[2] [ ]. . : http://ru.wikipedia.org/



















Parser.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MSSVIR
{
class Parser
{
public string Code { get; private set; }
public int curPos { get; private set; }
char[] IgnorableSymbols = {' ','\n','\t','\r'};
string VariableSymbols = "abcdefghijklmnopqrstuvwxyzABSDEFGHILKLMNOPQRSTUVWXYZ_1234567890";
public Graph Graph_ = new Graph("main");
public List<Graph> Functions = new List<Graph>();

public Parser(string PHPCode_, int pos, List<Graph> Functions_)
{
Code = PHPCode_;
curPos = pos;
if (Functions_ != null)
Functions = Functions_;
//Functions.Add(Graph);
}

private string GetToken()
{
string res = "";
bool tokenBegin = false;
bool CodeFinish = false;
while (!tokenBegin && !CodeFinish)
{
if (curPos == Code.Length - 1)
CodeFinish = true;
else
{
if (IgnorableSymbols.Contains(Code[curPos]))
curPos++;
else
tokenBegin = true;
}
}

if (!CodeFinish)
switch (Code[curPos])
{
case '(':
int num = 0;
curPos++;
while (!((Code[curPos] == ')') && (num == 0)))
{
if (Code[curPos] == '(')
num++;
if (Code[curPos] == ')')
num--;
if (Code[curPos] == '"')
{
res += '\\';
do
{
res += Code[curPos];
curPos++;
}
while (Code[curPos] != '"');
res += '\\';
}
res += Code[curPos];
curPos++;
}
curPos++;
break;
case '$':
res += Code[curPos];
curPos++;
while (VariableSymbols.Contains(Code[curPos]))
{
res += Code[curPos];
curPos++;
}
break;
default:
if (VariableSymbols.Contains(Code[curPos]))
while (VariableSymbols.Contains(Code[curPos]))
{
res += Code[curPos];
curPos++;
}
else
{
res += Code[curPos];
curPos++;
}
break;
}

return res;
}

private void GetNextLine()
{
string Token;
do
Token = GetToken();
while ((Token != ";") && (Token != ""));
if ((Token == ";") || Token == "") curPos--;

}

private void AddIf()
{
string res;
int IfBegin = curPos;
string usl = GetToken();
Graph_.AddBlock(false, "if (" + usl + ")");
Block If = Graph_.curBlock;
IfBegin = curPos;
if ((res = GetToken()) == "{")
GetBlock("}");
else
{
curPos = IfBegin;
GetBlock(";");
}
Graph_.AddBlock(true, "connection");
Block connection = Graph_.curBlock;
int IfEnd = curPos;
Graph_.curBlock = If;
if (GetToken() == "else")
{
if ((res = GetToken()) == "{")
GetBlock("}");
else
{
curPos = IfEnd;
GetBlock(";");
}
Graph_.curBlock.NextBlocks.Add(connection);
Graph_.curBlock = connection;
}
else
{
Graph_.curBlock.NextBlocks.Add(connection);
Graph_.curBlock = connection;
curPos = IfEnd;
}
}

private void AddWhile()
{
int WhileBegin = curPos;
string usl = GetToken();
Graph_.AddBlock(false, "while (" + usl + ")");
WhileBegin = curPos;
Block While = Graph_.curBlock;
if (GetToken() == "{")
GetBlock("}");
else
{
curPos = WhileBegin;
GetBlock(";");
}
Graph_.curBlock.NextBlocks.Add(While);
Graph_.curBlock = While;
}

private void AddFor()
{
string usl = GetToken();
Graph_.AddBlock(false, "for (" + usl + ")");
int WhileBegin = curPos;
Block While = Graph_.curBlock;
if (GetToken() == "{")
GetBlock("}");
else
{
curPos = WhileBegin;
GetBlock(";");
}
Graph_.curBlock.NextBlocks.Add(While);
Graph_.curBlock = While;
}

private void AddDo()
{
int DoBegin = curPos;
Graph_.AddBlock(true, "do");
Block Do = Graph_.curBlock;
if (GetToken() == "{")
GetBlock("}");
else
{
curPos = DoBegin;
GetBlock(";");
}
GetToken();
string usl = GetToken();
Graph_.AddBlock(false, "while (" + usl + ")");
Graph_.curBlock.NextBlocks.Add(Do);
}

private void AddFunction()
{
string FuncName = GetToken();
GetToken();
GetToken();

Graph Main = Graph_;
Graph_ = new Graph(FuncName);
GetBlock("}");
Functions.Add(Graph_);
Graph_ = Main;
//Parser NewFunc = new Parser(Code, curPos, Functions);
//NewFunc.GetBlock("}");
//NewFunc.Graph_.Label = FuncName;
//Functions.Add(NewFunc.Graph);
//for (int i = 0; i < NewFunc.Functions.Count; i++)
// Functions.Add(NewFunc.Functions[i]);
//curPos = NewFunc.curPos;

..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .