Giter Club home page Giter Club logo

linux-vim-editor's Introduction

Nucuta Diana 314 CC 
Tema 1 SD

Am utilizat urmatoarele stive:
-o stiva stack pentru a retine toate formele textului
-o stiva comenzi pentru a retine comenzile
-o stiva (redoStack) care ne ajuta sa salvam ce se intampla cand dam undo

Pe masura ce citesc din fisier adaug fie in stiva de text, fie in stiva de comenzi,
am un icounter care ma ajuta sa identific cand se introduc comenzi sau text
Cand icount e par e text, cand e impar sunt comenzi.
Cand sunt comenzi am un switch mare, scot acel '\n' de la final de buffer si
bag comanda in switch (tin cont totusi doar de primul cuvant din comanda deoarece restul pot
fi parametrii ei). Fiecarei comenzi ii corespunde un numar, alfa.
De fiecare data cand aplic o comanda, salvez in stack textul si daca comanda e save
atunci toata stiva de text se sterge inafara de top-ul ei, adica ultima forma.
Prin comanda quit ok devine 1, deci nu se mai citeste nimic din fisier si se termina executia programului.
(textul se citea din fisier cat timp q era 0), se da pop la tot ce era in stiva de text deoarece este posibil
sa nu se fi dat save asa ca in stiva text sa existe formele nesalvate.
Dupa fiecare comanda aplicata salvez starea textului in stiva text.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.