Please ues Visual Studio for this program This assignment gives you an opportuni
ID: 3834735 • Letter: P
Question
Please ues Visual Studio for this program
This assignment gives you an opportunity to use C++'s OOP features in the context of a larger program.
Be sure you are fully up to date with the source code of the Y editor. To clone the full source of Y, along with the two supporting projects it requires, use commands such as:
Be mindful of the case used for the names. The build control files depend on these names spelled in exactly this way.
If you already have the source code cloned, go into each folder and do:
This ensures you have the latest version. Next execute the following commands, in this order, to build the supporting projects and then Y itself:
The purpose of this assignment is to add a feature to Y so that it can run arbitrary processes and then execute the Y macros produced by those processes. Recall that Y continuously executes "macro words" that it obtains from some kind of word source.
Start by modifying WordSource.hpp and WordSource.cpp to add a class PipeWord that is derived from WordSource. The constructor of PipeWord should take a string that it will interpret to be a command (such as you might type at a shell prompt). It should then "open" the command for reading using the library popen function. See the manual page for popen for more information. Class PipeWord also needs to override get and unget since they are pure virtual methods in the base class. However, it should be able to just inherit get_word. See the implementation of FileWord for inspiration.
Once PipeWord is ready it is now necessary to hook it into Y's execution engine so it can be used. Start by creating a command function that can be used to execute processes. In the file command_e.cpp add a function such as:
The logic can be quite similar to that of execute_file_command except that it should call a function start_macro_process.
Add the function start_macro_process to the file macro_stack.cpp in a manner similar to the way start_macro_file is implemented.
Next it is necessary to associate a command name with the command function you just implemented. In command_table.cpp add an entry that associates the name "execute_process" with your implementation function.
At this point one might want to associate a keystroke with the newly created command so that users can invoke the command by typing some appropriate key combination. However, it is not necessary to do this because Y has a feature that allows users to enter arbitrary macro text at any time. Thus you are now ready to try the new feature.
You will need a program that generates Y macro text. One simple possibility would be to use the standard cat program on a text file. This is a bit unsatisfying, however, because Y already has a feature that allows you to execute macro text stored in a file. Instead consider the following Perl program:
The dot operator is Perl's string concatenation operator. Save this program to example.pl and use a command such as:
to make it executable. If you run it at the prompt it should output:
Imagine that this program computes the macro text in some complex way. Now run Y on a scratch file such as afile.txt. Inside Y use 'Ctrl+A m' (this is Ctrl+A followed by m) to open a box for entering arbitrary macro commands. Try running:
If everything works as desired the output of the Perl program should be executed by Y causing "Hello, Macro Processes!" to be added to the current file. Use 'Ctrl+A q' to exit Y without saving any files.
Explanation / Answer
is a coordinated improvement condition (IDE) from Microsoft. It is utilized to create PC programs for Microsoft Windows, and sites, web applications, web administrations and versatile applications. Visual Studio utilizes Microsoft programming improvement stages, for example, Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can create both local code and oversaw code.
Visual Studio incorporates a code editorial manager supporting IntelliSense (the code consummation segment) and additionally code refactoring. The coordinated debugger works both as a source-level debugger and a machine-level debugger. Other inherent instruments incorporate a code profiler, shapes creator for building GUI applications, website specialist, class architect, and database composition originator. It acknowledges modules that improve the usefulness at practically every level—including support for source control frameworks (like Subversion) and including new toolsets like editors and visual architects for area particular dialects or toolsets for different parts of the product advancement lifecycle (like the Team Foundation Server customer: Team Explorer).
Visual Studio underpins 36 distinctive programming dialects and permits the code manager and debugger to support (to differing degrees) almost any programming dialect, gave a dialect particular administration exists. Worked in dialects incorporate C,[6] C++ and C++/CLI (by means of Visual C++), VB.NET (by means of Visual Basic .NET), C# (through Visual C#), F# (as of Visual Studio 2010[7]) and TypeScript (as of Visual Studio 2013 Update 2). Bolster for different dialects, for example, Python,[8] Ruby, Node.js, and M among others is accessible by means of dialect administrations introduced independently. It likewise underpins XML/XSLT, HTML/XHTML, JavaScript and CSS. Java (and J#) were upheld before.
Microsoft gives a free form of Visual Studio called the Community version that backings modules and is accessible at no cost