Senin, 13 April 2015

Level of syntax ( by : Lily Hayati )



Levels of syntax
Computer language syntax is generally distinguished into three levels:
  • Words – the lexical level, determining how characters form tokens;
  • Phrases – the grammar level, narrowly speaking, determining how tokens form phrases;
  • Context – determining what objects or variables names refer to, if types are valid, etc.
Distinguishing in this way yields modularity, allowing each level to be described and processed separately, and often independently. First a lexer turns the linear sequence of characters into a linear sequence of tokens; this is known as "lexical analysis" or "lexing". Second the parser turns the linear sequence of tokens into a hierarchical syntax tree; this is known as "parsing" narrowly speaking. Thirdly the contextual analysis resolves names and checks types. This modularity is sometimes possible, but in many real-world languages an earlier step depends on a later step – for example, the lexer hack in C is because tokenization depends on context. Even in these cases, syntactical analysis is often seen as approximating this ideal model.
The parsing stage itself can be divided into two parts: the parse tree or "concrete syntax tree" which is determined by the grammar, but in general far too detailed for practical use, and the abstract syntax tree (AST), which simplifies this into a usable form. The AST and contextual analysis steps can be considered a form of semantic analysis, as they are adding meaning and interpretation to the syntax, or alternatively as informal, manual implementations of syntactical rules that would be difficult or awkward to describe or implement formally.
The levels generally correspond to levels in the Chomsky hierarchy. Words are in a regular language, specified in the lexical grammar, which is a Type-3 grammar, generally given as regular expressions. Phrases are in a context-free language (CFL), generally a deterministic context-free language (DCFL), specified in a phrase structure grammar, which is a Type-2 grammar, generally given as production rules in Backus–Naur Form (BNF). Phrase grammars are often specified in much more constrained grammars than full context-free grammars, in order to make them easier to parse; while the LR parser can parse any DCFL in linear time, the simple LALR parser and even simpler LL parser are more efficient, but can only parse grammars whose production rules are constrained. Contextual structure can in principle be described by a context-sensitive grammar, and automatically analyzed by means such as attribute grammars, though in general this step is done manually, via name resolution rules and type checking, and implemented via a symbol table which stores names and types for each scope.
Tools have been written that automatically generate a lexer from a lexical specification written in regular expressions and a parser from the phrase grammar written in BNF: this allows one to use declarative programming, rather than need to have procedural or functional programming. A notable example is the lex-yacc pair. These automatically produce a concrete syntax tree; the parser writer must then manually write code describing how this is converted to an abstract syntax tree. Contextual analysis is also generally implemented manually. Despite the existence of these automatic tools, parsing is often implemented manually, for various reasons – perhaps the phrase structure is not context-free, or an alternative implementation improves performance or error-reporting, or allows the grammar to be changed more easily. Parsers are often written in functional languages, such as Haskell, in scripting languages, such as Python or Perl, or in C or C++.
Examples of errors
Main article: Syntax error
As an example, (add 1 1) is a syntactically valid Lisp program (assuming the 'add' function exists, else name resolution fails), adding 1 and 1. However, the following are invalid:
(_ 1 1)    lexical error: '_' is not valid
(add 1 1   parsing error: missing closing ')'
(add 1 x)  name error: 'x' is not bound
Note that the lexer is unable to identify the error – all it knows is that, after producing the token LEFT_PAREN, '(' the remainder of the program is invalid, since no word rule begins with '_'. At the parsing stage, the parser has identified the "list" production rule due to the '(' token (as the only match), and thus can give an error message; in general it may be ambiguous. At the context stage, the symbol 'x' exists in the syntax tree, but has not been defined, and thus the context analyzer can give a specific error.
In a strongly typed language, type errors are also a form of syntax error which is generally determined at the contextual analysis stage, and this is considered a strength of strong typing. For example, the following is syntactically invalid Python code (as these are literals, the type can be determined at parse time):
'a' + 1
…as it adds a string and an integer. This can be detected at the parsing (phrase analysis) level if one has separate rules for "string + string" and "integer + integer", but more commonly this will instead be parsed by a general rule like "LiteralOrIdentifier + LiteralOrIdentifier" and then the error will be detected at contextual analysis stage, where type checking occurs. In some cases this validation is not done, and these syntax errors are only detected at runtime.
In a weakly typed language, where type can only be determined at runtime, type errors are instead a semantic error, and can only be determined at runtime. The following Python code:
a + b
is ambiguous, and while syntactically valid at the phrase level, it can only be validated at runtime, as variables do not have type in Python, only values do.
Syntax definition
http://upload.wikimedia.org/wikipedia/en/thumb/c/cb/Python_add5_parse.svg/396px-Python_add5_parse.svg.png
http://bits.wikimedia.org/static-1.23wmf13/skins/common/images/magnify-clip.png
Parse tree of Python code with inset tokenization
The syntax of textual programming languages is usually defined using a combination of regular expressions (for lexical structure) and Backus–Naur Form (for grammatical structure) to inductively specify syntactic categories (nonterminals) and terminal symbols. Syntactic categories are defined by rules called productions, which specify the values that belong to a particular syntactic category.[1] Terminal symbols are the concrete characters or strings of characters (for example keywords such as define, if, let, or void) from which syntactically valid programs are constructed.
A language can have different equivalent grammars, such as equivalent regular expressions (at the lexical levels), or different phrase rules which generate the same language. Using a broader category of grammars, such as LR grammars, can allow shorter or simpler grammars compared with more restricted categories, such as LL grammar, which may requires longer grammars with more rules. Different but equivalent phrase grammars yield different parse trees, though the underlying language (set of valid documents) is the same.
Example: Lisp
Below is a simple grammar, defined using the notation of regular expressions and Backus–Naur Form. It describes the syntax of Lisp, which defines productions for the syntactic categories expression, atom, number, symbol, and list:
expression ::= atom   | list
atom       ::= number | symbol   
number     ::= [+-]?['0'-'9']+
symbol     ::= ['A'-'Z''a'-'z'].*
list       ::= '(' expression* ')'
This grammar specifies the following:
  • an expression is either an atom or a list;
  • an atom is either a number or a symbol;
  • a number is an unbroken sequence of one or more decimal digits, optionally preceded by a plus or minus sign;
  • a symbol is a letter followed by zero or more of any characters (excluding whitespace); and
  • a list is a matched pair of parentheses, with zero or more expressions inside it.
Here the decimal digits, upper- and lower-case characters, and parentheses are terminal symbols.
The following are examples of well-formed token sequences in this grammar: '12345', '()', '(a b c232 (1))'
Complex grammars
The grammar needed to specify a programming language can be classified by its position in the Chomsky hierarchy. The phrase grammar of most programming languages can be specified using a Type-2 grammar, i.e., they are context-free grammars,[2] though the overall syntax is context-sensitive (due to variable declarations and nested scopes), hence Type-1. However, there are exceptions, and for some languages the phrase grammar is Type-0 (Turing-complete).
In some languages like Perl and Lisp the specification (or implementation) of the language allows constructs that execute during the parsing phase. Furthermore, these languages have constructs that allow the programmer to alter the behavior of the parser. This combination effectively blurs the distinction between parsing and execution, and makes syntax analysis an undecidable problem in these languages, meaning that the parsing phase may not finish. For example, in Perl it is possible to execute code during parsing using a BEGIN statement, and Perl function prototypes may alter the syntactic interpretation, and possibly even the syntactic validity of the remaining code.[3] Colloquially this is referred to as "only Perl can parse Perl" (because code must be executed during parsing, and can modify the grammar), or more strongly "even Perl cannot parse Perl" (because it is undecidable). Similarly, Lisp macros introduced by the defmacro syntax also execute during parsing, meaning that a Lisp compiler must have an entire Lisp run-time system present. In contrast C macros are merely string replacements, and do not require code execution.[4][5]
Syntax versus semantics
The syntax of a language describes the form of a valid program, but does not provide any information about the meaning of the program or the results of executing that program. The meaning given to a combination of symbols is handled by semantics (either formal or hard-coded in a reference implementation). Not all syntactically correct programs are semantically correct. Many syntactically correct programs are nonetheless ill-formed, per the language's rules; and may (depending on the language specification and the soundness of the implementation) result in an error on translation or execution. In some cases, such programs may exhibit undefined behavior. Even when a program is well-defined within a language, it may still have a meaning that is not intended by the person who wrote it.
Using natural language as an example, it may not be possible to assign a meaning to a grammatically correct sentence or the sentence may be false:
  • "Colorless green ideas sleep furiously." is grammatically well formed but has no generally accepted meaning.
  • "John is a married bachelor." is grammatically well formed but expresses a meaning that cannot be true.
The following C language fragment is syntactically correct, but performs an operation that is not semantically defined (because p is a null pointer, the operations p->real and p->im have no meaning):
 complex *p = NULL;
 complex abs_p = sqrt (p->real * p->real + p->im * p->im);
More simply:
 int x;
 printf("%d", x);

Syntax is the body of rules that govern sentence structure and formation in a language. A sentence is usually defined as a grammatical unit that is composed of one or more clauses that expresses a thought. It also may be composed of elliptical constructions, a single word or short phrase that has meaning within a given context.

Syntax primarily deals with phrases, their structure and how they are assembled together. The basic building block phrases are noun phrases, which have a noun as a head word, and verb phrases, which have a verb as a head word. These may contain adjectival and adverbial units and prepositional phrases, as well as dependent, subordinate phrases.

Here is an example sentence:
'The clever young girl adeptly tripped the burglar in the hallway before he could turn on the light.'

The noun phrase is 'the clever young girl,' while the verb phrase is 'adeptly tripped the burglar'. The adjectival unit is contained within the noun phrase 'clever young'. The adverbial unit is contained within the verb phrase 'adeptly'. The prepositional phrase is 'in the hallway'. The subordinate clause is 'before he could turn on the light'.

pengantar MPMBS ( by : Lily Hayati )



PENGANTAR MPMBS
(MANAJEMEN PENINGKATAN MUTU BERBASIS SEKOLAH )

A. Latar belakang MPMBS
Faktor pertama : kebijakan dan penyelenggara pendidikan nasional menggunakan pendekatan education production function atau input-output analysis yang tidak dilaksanakan secara konsekuen.
Faktor kedua : penyelenggara pendidikan nasional dilakukan secara birokratik-sentralistik.
Faktor ketiga : Peranserta masyarakat, khususnya orang tua siswa dalam menyelenggarakan pendidikan selama ini sangat minim.

B. Pengertian MPMBS
MPMBS dapat diartikan sebagai model manajemen yang memberikan otonomi lebih besar kepada sekolah dan mendorong mengambil keputusan partisipatif.

C. Tujuan MPMBS
Meningkatkan mutu pendidikan melalui peningkatan kemandirian, fleksibilitas, partisipasi, keterbukaan, kerjasama, akuntabilitas, sustainbilitas, dan inisiatif sekolah dalam mengelola, memanfaatkan dalam memberdayakansumber daya yang tersedia.

D. Prinsip Dasar MPMBS
1.        Kemandirian
2.        Transparansi
3.        Kerjasama dan keputusan partisipatif
4.        Akuntabilitas public
5.        Sustainabilitas (berkelanjutan)
6.        Orientasi pada mutu pendidikan

E. Manfaat MPMBS
1.        Memberi peluang bagi seluruh anggota sekolah yang terlibat dalam pengambilan putusan penting.
2.        Mendorong munculnya kreativitas dalam pembelajaran.
3.        Mengarahkan kembali sumber dayayang tersedia untuk mendukung tujuan yang dikembangkan disetiap sekolah
4.        Menghasilkan rencana anggaran yang lebih realistik
5.        Meningkatkan motovasi guru dan mengembangkan kepemimpinan baru disetiap level.



MPMBS ( Created by Lily Hayati )





A.    Latar Belakang Masalah yang muncul di Sekolah
            Bullying adalah tindakan mengintimidasi dan memaksa seorang individu atau kelompok yang lebih lemah untuk melakukan sesuatu di luar kehendak mereka, dengan maksud untuk membahayakan fisik, mental atau emosional melalui pelecehan dan penyerangan. Orang tua sering tidak menyadari, anaknya menjadi korban bullying di sekolah.

               Bentuk yang paling umum dari bentuk penindasan/ bullying di sekolah adalah pelecehan verbal, yang bisa datang dalam bentuk ejekan, menggoda atau meledek dalam penyebutan nama. Jika tidak diperhatikan, bentuk penyalahgunaan ini dapat meningkat menjadi teror fisik seperti menendang, meronta-ronta dan bahkan pemerkosaan.

               Biasanya pelaku memulai bullying di sekolah pada usia muda, dengan melakukan teror pada anak laki-laki dan perempuan secara emosional atau intimidasi psikologis. Anak mengganggu karena berbagai alasan. Biasanya karena mencari perhatian dari teman sebaya dan orang tua mereka, atau juga karena merasa penting dan merasa memegang kendali. Banyak juga bullying di sekolah dipacu karena meniru tindakan orang dewasa atau program televisi.

                 Bullying merupakan perilaku yang tidak normal, tidak sehat, dan secara sosial tidak dapat diterima. Namun dalam kehidupan sehari-hari dan di era saat ini peningkatan kasus bullying banyak terjadi terutama disekolah-sekolah. Banyakny kasus bullying yang terjadi belakangan ini dipicu oleh berbagai macam hal seperti kurangya pengetahuan tentang bullying atau sistem aturan sekolah yang kurang ketat dan anggapan sepele tentang perlakuan bullying. Padahal anggapan sepelepun akan berdampak sangat fatal jika dilakukan berulang-ulang atau dibiarkan. 

                 Oleh karena itu, perilaku seperti ini tidak dapat dibiarkan karena apabila perilaku seperti ini dibiarkan maka secara tidak disadari akan dapat memberikan bullies power kepada pelaku bullying, menciptakan interaksi sosial tidak sehat, serta meningkatkan budaya kekerasan.






B.     Penjelasan dan Pemahaman kasus
                      Bullying adalah bentuk-bentuk perilaku kekerasan dimana terjadi pemaksaan secara psikologis ataupun fisik terhadap seseorang atau sekelompok orang yang lebih “lemah” oleh seseorang atau sekelompok orang. Pelaku bullying yang biasa disebut bully bisa seseorang atau bisa juga sekelompok orang. Pelaku bullying umumnya mempersepsikan dirinya memiliki power (kekuasaan) untuk melakukan apa saja terhadap korbannya.

                 Korban juga mempersepsikan dirinya sebagai pihak yang lemah, tidak berdaya dan selalu merasa terancam oleh bully.
Menurut Riauskina, Djuwita, dan Soesetiono (jurnal psikologi Sosial 12 (01), 2005 : 1-13 ) mendefinisikan bahwa School bullying atau yang merupakan bullying yang terjadi disekolah merupakan perilaku agresif yang dilakukan berulang-ulang oleh seseorang/kelompok siswa yang memiliki kekuasaan, terhadp siswa/siswi lain yang lebih lemah, dengan tujuan menyakiti orang tersebut.

                 Bentuk yang paling umum dari bentuk penindasan/ bullying di sekolah adalah pelecehan verbal, yang bisa datang dalam bentuk ejekan, menggoda atau meledek dalam penyebutan nama. Jika tidak diperhatikan, bentuk penyalahgunaan ini dapat meningkat menjadi teror fisik seperti menendang, meronta-ronta dan bahkan pemerkosaan.


C.    Deskripsi Permasalahn
                  Kasus ini menimpa salah seorang siswi yang bernama EMBUN (nama samaran). EMBUN merupakan anak dari salah seorang guru disekolah. Umumnya disekolah manapun anak guru selalu disegani, akan tetapi tidak dengan EMBUN. EMBUN memperoleh perlakuan bullying setiap hari dari teman-teman dikelasnya yaitu oleh sekelompok orang. Bentuk perlakuan bullying yang diterimanya adalah berupa ejekan, hinaan, atau dengan panggilan-panggilan yang tujuannya menghina.

                      Hal ini dikarenakan lantaran teman-teman dikelasnya malu berteman dengannya dan tak mau menjadi objek bullyan seperti EMBUN. Padahal hal semacam itu dapat berdampak besar bagi perkembangan psikologis dari korban. Namun kasus ini tidak pernah mendapat penanganan dari pihak sekolah melalui guru BK ataupun orang tua. Hal ini disebabkan oleh karena tidak ada yang melapor tentang kasus tersebut termasuk korban itu sendiri.

                  Akibat dari perlakuan bullying yang diterimanya, korban mengalami tekanan terhadap psikologisnya. Hal ini terlihat dari menurunnya kepercayaan diri (self-esteem), malu, merasa sendiri, dan cenderung merasa rendah diri.
D.    Penanganan Kasus tersebut :
a. Pendekatan penghapusan (obilition)
                  Merupakan pendekatan yang dilakukan dengan cara menghapus kasus bullying yang terdapat disekolahan. Dengan melakukan upaya-upaya prefentif dan interventif dengan menindak tegas pelaku bullying yaitu dengan mengatasi masalah yang menjadi akar dari fenomena tersebut.

b. Pendekatan perlindungan
                Ialah suatu pendekatan yang menitik beratkan pada perlindungan dan pemberian hak-hak kepada setiap siswa. Karena setiap orang memiliki hak masing-masing yang tertuang kedalam Hak Asasi Manusia seperti hak kebebasan, termasuk memperoleh perlindungan. Perlindungan tersebut dapat melalui perumusan hukum-hukum dan aturan sekolah. selain itu juga melalui peningkatan peran lembaga sekolah, dan keluarga

c. Program Intervensi contohnya sbb :
a. Membuat kebijakan
b. Pemberian motivasi terhadap guru
c. Menciptakan atmosfer kelas yang baik
d. Melakukan sosialisasi terkait dengan apa itu bullying, dampak yang diakibatkan kepada siswa, dan pertolongan yang didapatkan siswa.
e. Melakukan pengawasan dan monitoring perilaku siswa diluar kelas.
f. Melibatkan orang tua korban bullying dan mengundang mereka untuk datang ke sekolah guna  mendiskusikan bagaimana perilaku bullying dapat dirubah.
g. Menyelenggarakan case coference. Korban didorong untuk menyatakan kesedihan dihadapan orang yang telah melakukan bully.


E.     Kesimpulan dari Penulis
                        Bullying adalah bentuk-bentuk perilaku kekerasan dimana terjadi pemaksaan secara psikologis ataupun fisik terhadap seseorang atau sekelompok orang yang lebih “lemah” oleh seseorang atau sekelompok orang. Sementara itu, School bullying adalah perlakuan tidak menyenangkan yang dialami oleh siswa disekolah. Pelaku school bullying pada umumnya adalah teman sebaya, siswa yang lebih senior, atau bahkan guru. School bullying memberi banyak sekali dampak buruk kepada siswa yang menjadi korban diantaranya yaitu menurunnya rasa kepercayaan diri, tekanan psikologis, dan sebagainya.

                Oleh karena itu school bullying menjadi masalah fundamental untuk segera diatasi.
Terkait dengan kasus yang terjadi pada klien EMBUN yang mengalami dampak cukup serius yaitu berupa penurunan rasa kepercayaan diri, maka diperlukan langkah-langkah penangan seperti Membuat kebijakan, Pemberian motivasi terhadap guru, Menciptakan atmosfer kelas yang baik, Melakukan sosialisasi terkait dengan apa itu bullying, dampak yang diakibatkan kepada siswa, dan pertolongan yang didapatkan siswa, Melakukan pengawasan dan monitoring perilaku siswa diluar kelas, Melibatkan orang tua korban bullying dan mengundang mereka untuk datang ke sekolah guna mendiskusikan bagaimana perilaku bullying dapat dirubah., Menyelenggarakan case coference. Korban didorong untuk menyatakan kesedihan dihadapan orang yang telah melakukan bully. Hal ini perlu dilakukan guna mewujudkan upaya perlindungan bagi korban dan upaya penghapusan masalah bullying dari sekolah.Sesungguhnya, di banyak kasus lain korban school bullying tidak hanya menderita ketakutan disekolah saja, melainkan juga dapat menyebabkan meninggalnya korban.