Tuesday, October 15, 2013

SYNTAX

SYNTAX



Syntax is the grammar, structure, or order of the elements in a language statement. (Semantics is the meaning of these elements.) Syntax applies to computer languages as well as to natural languages. Usually, we think of syntax as "word order." However, syntax is also achieved in some languages such as Latin by inflectional case endings. In computer languages, syntax can be extremely rigid as in the case of most assembler languages or less rigid in languages that make use of "keyword" parameters that can be stated in any order.

Parse tree

A concrete syntax tree or parse tree is an (ordered, rooted) tree that represents the syntactic structure of a string according to some formal grammar. In a parse tree, the interior nodes are labeled by non-terminals of the grammar, while the leaf nodes are labeled by terminals of the grammar. Parse trees may be generated for sentences in natural languages (see natural language processing), as well as during processing of computer languages, such as programming languages. Parse trees are distinct from abstract syntax trees (also known simply as syntax trees), in that their structure and elements more concretely reflect the syntax of the input language.

Noun phrase
A noun phrase includes a noun—a person, place, or thing—and the modifiers which distinguish it.
You can find the noun dog in a sentence, for example, but you don't know which canine the writer means until you consider the entire noun phrase.

Verb phrase 
Every sentence must have a verb. To depict doable activities, writers use action verbs. To describe conditions, writers choose linking verbs.
Sometimes an action or condition occurs just once—pow!—and it's over.


Determiners
A word or a group of words that introduces a noun. Determiners include articles, demonstratives, quantifiers, and possessive determiners.
Determiners are functional elements of structure and not 

Adjective
An adjective modifies a noun or a pronoun by describing, identifying, or quantifying words. An adjective usually precedes the noun or the pronoun which it modifies.

Adverbs
An adverb can be added to a verb to modify its meaning. Usually, an adverb tells you when, where, how, in what manner or to what extent an action is performed. Very many adverbs end in '...ly' - particularly those that are used to express how an action is performed. Although many adverbs end 'ly', lots do not, e.g., fast, never, well, very, most, least, more, less, now, far and there.

Pronouns
Most of the time, a pronoun is used to replace a noun. The following are all pronouns: he, she, they, none, and which. There are lots more. As you can see, pronouns are usually short words. They are used to make sentences less cumbersome and less repetitive.



Prepositional phrases
Prepositional phrases modify nouns and verbs while indicating various relationships between subjects and verbs. They are used to color and inform sentences in powerful ways.
Like adjectives and adverbs, prepositional phrases add meaning to the nouns and verbs in our sentences.

Auxiliary Verb
Every sentence must have a verb. To depict doable activities, writers use action verbs. To describe conditions, writers choose linking verbs.
Sometimes an action or condition occurs just once—bang!—and it's over.

Nate stubbed his toe.

He is miserable with pain.

No comments:

Post a Comment