Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Paskal/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compiled Object files
# Compiled Object files
*.slo
*.lo
*.o
Expand Down Expand Up @@ -27,4 +27,5 @@
*.exe
*.out
*.app
/Студенты/
/.vs/
/Debug/
Binary file modified Paskal/.vs/Paskal/v15/.suo
Binary file not shown.
Binary file modified Paskal/.vs/Paskal/v15/Browse.VC.db
Binary file not shown.
Binary file modified Paskal/Debug/Paskal.ilk
Binary file not shown.
Binary file modified Paskal/Debug/Paskal.pdb
Binary file not shown.
19 changes: 19 additions & 0 deletions Paskal/Paskal.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ VisualStudioVersion = 15.0.28010.2019
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Paskal", "Paskal\Paskal.vcxproj", "{F6A82001-E226-4B43-AB63-98DA5CF814E4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest\gtest.vcxproj", "{60932AFC-7808-48B7-B3BF-F2BC151C0065}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base_test", "base_test\base_test.vcxproj", "{F266A6B4-CBC2-41C0-9F55-056959ABA352}"
ProjectSection(ProjectDependencies) = postProject
{F6A82001-E226-4B43-AB63-98DA5CF814E4} = {F6A82001-E226-4B43-AB63-98DA5CF814E4}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -21,6 +28,18 @@ Global
{F6A82001-E226-4B43-AB63-98DA5CF814E4}.Release|x64.Build.0 = Release|x64
{F6A82001-E226-4B43-AB63-98DA5CF814E4}.Release|x86.ActiveCfg = Release|Win32
{F6A82001-E226-4B43-AB63-98DA5CF814E4}.Release|x86.Build.0 = Release|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Debug|x64.ActiveCfg = Debug|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Debug|x86.ActiveCfg = Debug|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Debug|x86.Build.0 = Debug|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Release|x64.ActiveCfg = Release|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Release|x86.ActiveCfg = Release|Win32
{60932AFC-7808-48B7-B3BF-F2BC151C0065}.Release|x86.Build.0 = Release|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Debug|x64.ActiveCfg = Debug|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Debug|x86.ActiveCfg = Debug|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Debug|x86.Build.0 = Debug|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Release|x64.ActiveCfg = Release|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Release|x86.ActiveCfg = Release|Win32
{F266A6B4-CBC2-41C0-9F55-056959ABA352}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Paskal/Paskal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Debug/
21 changes: 21 additions & 0 deletions Paskal/Paskal/Circle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
program Example;
const
Pi: double = 3,1415926;
var
R, L, S: double;
begin
Write("��� ��������� ������� ����� ���������� � � �������.");
Write(" ������� ������ ����������: ");
Read(R);
if (R < 0) then
begin
Write("������ �� ����� ���� �������������");
end
else
begin
L := 2 * Pi * R;
Write("����� �����. = ", L);
S := Pi * R * R;
Write(" ������� �����. = ", S);
end
end.
19 changes: 18 additions & 1 deletion Paskal/Paskal/Debug/Paskal.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
 Packal_main.cpp
Paskal.vcxproj -> D:\рабочий стол\настя\АиСД\Paskal\Debug\Paskal.exe
Text.cpp
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(72): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(82): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(253): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(284): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(293): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(363): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(366): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(448): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(451): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(474): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(548): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(555): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(570): warning C4018: <: несоответствие типов со знаком и без знака
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(335): warning C4101: s: неиспользованная локальная переменная
d:\настя\аисд\паскаль2\compiler-pascal\paskal\paskal\text.cpp(527): warning C4101: s: неиспользованная локальная переменная
Создание кода...
Paskal.vcxproj -> D:\настя\АиСД\паскаль2\Compiler-Pascal\Paskal\Debug\Paskal.exe
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/CL.command.1.tlog
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 1 addition & 1 deletion Paskal/Paskal/Debug/Paskal.tlog/Paskal.lastbuildstate
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17134.0
Debug|Win32|D:\рабочий стол\настя\АиСД\Paskal\|
Debug|Win32|D:\настя\АиСД\паскаль2\Compiler-Pascal\Paskal\|
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/link.command.1.tlog
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/Paskal.tlog/link.write.1.tlog
Binary file not shown.
Binary file removed Paskal/Paskal/Debug/hash1table.obj.enc
Binary file not shown.
Binary file removed Paskal/Paskal/Debug/paskal_main.obj.enc
Binary file not shown.
Binary file removed Paskal/Paskal/Debug/text.obj.enc
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/vc141.idb
Binary file not shown.
Binary file modified Paskal/Paskal/Debug/vc141.pdb
Binary file not shown.
17 changes: 17 additions & 0 deletions Paskal/Paskal/DotProduct.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
program Example;
var
x1, x2, x3: double;
y1, y2, y3: double;
R : double;
begin
Write("��� ��������� ������� ��������� ������������ ��������. ������� ��������������� x1 x2 x3: ");
Read(x1);
Read(x2);
Read(x3);
Write("������� ��������������� y1 y2 y3: ");
Read(y1);
Read(y2);
Read(y3);
R := x1 * y1 + x2 * y2 + x3 * y3;
Write("���������: ", R);
end.
2 changes: 1 addition & 1 deletion Paskal/Paskal/Hierarchy_List.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class THierarchy_List
link<T> *p = new link<T>;
ListLen = 0;
}
/* ����������*/


bool Is_Empty(); //�������� �� �������
void Set_check(int _c); //��������� check
Expand Down
23 changes: 16 additions & 7 deletions Paskal/Paskal/Packal_main.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#include <iostream>
#include <string>
//#include <Windows.h>
#include <cstdlib>
#include<locale>
#include <locale>
#include "Text.h"

using namespace std;

//��������� ���������:
// Paskal.txt - ���� 1
// Circle.txt - ���������� �����/������� ����������
// DotProduct.txt - ��������� ������������
int main()
{
setlocale(LC_ALL, "RUS");
//SetConsoleCP(1251); //����� ���������� Windows.h
//SetConsoleOutputCP(1251);
setlocale(LC_ALL, "ru");
TText t;
string name;
cout << " ������� �����:" << endl;
Expand All @@ -17,10 +24,7 @@ int main()
cout << " 3)� ������ var ������������ �������� �� �����������." << endl;
cout << " 4)�������� ��������� �������� ��� �����������:" << endl;
cout << "+, -, *, / (��� �������), mod (��� �����), div (��� �����), sin, cos, tg, ctg, ln" << endl;
cout << " 5)���� � if ���������� ������ �������� �������� ���������� if � else," << endl;
cout << " �� �� ����������� � begin-end." << endl;
cout << " 6)� Write ������� ����� �� �����������." << endl;
cout << " 7) ����������� �������������� � �������� ������� Read, Write, " << endl;
cout << " 5) ����������� �������������� � �������� ������� Read, Write, " << endl;
cout << "��������� �������� ���������: if, else, �� ������� ���������: <, >, =;" << endl;
cout << "���������� �������� ���������� � �������� ��� ����." << endl << endl;
try
Expand All @@ -29,7 +33,12 @@ int main()
cout << "1 - ��������� ��������� �� ����� " << endl;
cout << "2 - ������ � �������" << endl;
cin >> name;
if (name == "1") t.Read_and_out_file("Paskal.txt");
if (name == "1")
{
cout << "������� ��� ����� " << endl;
cin >> name;
t.Read_and_out_file(name);
}
else if (name == "2") t.Enter_Programm();
else throw ("Error of enter");
t.Line_processing();
Expand Down
8 changes: 4 additions & 4 deletions Paskal/Paskal/Paskal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ var
Res, d: double;
begin
num1 := 5;
Write("Введите четное целое число: ");
Write("������� ������ ����� �����: ");
Read(num2);
Write("Введите вещественное число: ");
Write("������� ������������ �����: ");
Read(d);
if (num2 mod 2 = 0) then
begin
Res := (num1 - num2 * 5 div 2) / ((d + 2) * 2);
Write("Результат = ", Res);
Write("��������� = ", Res);
end
else
Write("Неверный ввод");
Write("�������� ����");
if (num2 > 0) then
begin
if (d > 2) then
Expand Down
8 changes: 6 additions & 2 deletions Paskal/Paskal/Paskal.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ProjectGuid>{F6A82001-E226-4B43-AB63-98DA5CF814E4}</ProjectGuid>
<RootNamespace>Paskal</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<ProjectName>Paskal</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -76,7 +77,12 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>%(AdditionalLibraryDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down Expand Up @@ -118,14 +124,12 @@
<ClInclude Include="Hash1Table.h" />
<ClInclude Include="Hierarchy_List.h" />
<ClInclude Include="Postfix.h" />
<ClInclude Include="SortArTable.h" />
<ClInclude Include="Text.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Hash1Table.cpp" />
<ClCompile Include="Packal_main.cpp" />
<ClCompile Include="Postfix.cpp" />
<ClCompile Include="SortArTable.cpp" />
<ClCompile Include="Text.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
6 changes: 0 additions & 6 deletions Paskal/Paskal/Paskal.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
<ClInclude Include="Text.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="SortArTable.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="Hash1Table.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
Expand All @@ -35,9 +32,6 @@
<ClCompile Include="Text.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="SortArTable.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="Packal_main.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
Expand Down
26 changes: 25 additions & 1 deletion Paskal/Paskal/Postfix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,30 @@ bool TPostfix::Is_Operator(char c)
}
return tmp;
}

string TPostfix::Is_Unary_operation2(int &i) //�������� �� ������� ��������
{
string tmp = "";
if ((i < postfix.length() - 1) && (((postfix[i] == 's') && (postfix[i + 1] == 'i') && (postfix[i + 2] == 'n'))
|| ((postfix[i] == 'c') && (postfix[i + 1] == 'o') && (postfix[i + 2] == 's'))
|| ((postfix[i] == 'c') && (postfix[i + 1] == 't') && (postfix[i + 2] == 'g'))))
{
tmp += postfix[i];
tmp += postfix[i + 1];
tmp += postfix[i + 2];
i += 2;
}
else if ((i < postfix.length() - 2) && (((postfix[i] == 't') && (postfix[i + 1] == 'g'))
|| ((postfix[i] == 'l') && (postfix[i + 1] == 'n'))
|| ((postfix[i] == '+') && (postfix[i + 1] == '+'))
|| ((postfix[i] == '-') && (postfix[i + 1] == '-'))))
{
tmp += postfix[i];
tmp += postfix[i + 1];
i += 1;
}
return tmp;
}
string TPostfix::Is_mod_or_div(int & i) //�������� �� mod � div
{
string tmp = "";
Expand Down Expand Up @@ -310,7 +334,7 @@ double TPostfix::Calculate(THash1Table * table, string _type)
i = j;
continue;
}
else if (Is_Unary_operation(i) != "") //���� ������� ��������
else if (Is_Unary_operation2(i) != "") //���� ������� ��������
{
right_op = res.top(); //���� ������ �������
res.pop();
Expand Down
3 changes: 2 additions & 1 deletion Paskal/Paskal/Postfix.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class TPostfix
void Delete_Space(); //�������� ��������
int Check_Parentheses(const string& c)const; //���� ������
int Check_Str(); //�������� ������ �� ������������
string Is_Unary_operation(int &i); //�������� �� ������� ��������
string Is_Unary_operation(int &i); //�������� �� ������� �������� � �������
string Is_Unary_operation2(int &i); //�������� �� ������� �������� � ���������
bool Is_Operator(char c); //�������� �� ������ ����������
int Priority(string c); //�������� ��������� ���������
string Is_mod_or_div(int &i); //�������� �� ������ mod ��� div
Expand Down
Loading