TRENDING NEWS

POPULAR NEWS

What Is The Proper Way To Describe The Syntax Of

What does syntax mean?

1) In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be syntactically correct programs in that language. The syntax of a language defines its surface form. Text-based programming languages are based on sequences of characters, while visual programming languages are based on the spatial layout and connections between symbols (which may be textual or graphical).
---------
2) The lexical grammar of a textual language specifies how characters must be chunked into tokens. Other syntax rules specify the permissible sequences of these tokens and the process of assigning meaning to these token sequences is part of semantics.

In linguistics, syntax is the study of the principles and rules for constructing sentences in natural languages. In addition to referring to the discipline, the term syntax is also used to refer directly to the rules and principles that govern the sentence structure of any individual language, as in "the syntax of Modern Irish."

Modern research in syntax attempts to describe languages in terms of such rules. Many professionals in this discipline attempt to find general rules that apply to all natural languages. The term syntax is also sometimes used to refer to the rules governing the behavior of mathematical systems, such as logic, artificial formal languages, and computer programming languages.

Ron

Describe logic error, syntax error and run?

A logic error is a programming error that leads the computer to do the wrong thing. You select the "boil egg" feature and it activates the "launch nuclear weapon" feature instead. The program makes progress, but in the wrong direction.

A syntax error is a programming error that prevents the computer understanding you. You type "good morning" at a C compiler and it wil have no idea what you mean. The computer tells you the program is no good as soon as you present it to it.

A run-time error is one that the computer spots once the program has been launched. You ask the computer to divide by zero, to look at a non-existent memory address or to allocate more memory that is available. The computer starts of running the program as if everything is going to be fine, but at some point spots something has gone wrong.

Different errors have different costs.

A syntax error happens when you first type the program in, you will know about it immediately, it normally involves one person and is cheap to fix.

A run-time error happens when a sequence of events occur. This may be spotted immediately, in test or in the field. You have a good chance of being able to define what causes the run-time error to occur; typically the computer may even provide you with a corpse you can examine for clues as to why it died. These errors are always more expensive than syntax errors to fix because they occur late, perhaps even in the field.

A logic error happens when the program runs in a particular scenario. This may be spotted immediately, but equally well may never be spotted. The program may crash with a run-time error as a result of a logic error, but it may just do the wrong thing. The wrong thing caused by a logic error may vary from giving the wrong result to allowing someone to break into your computer with a virus. There errors can be extremely costly to fix, especially if they result in security problems involving the theft of goods or money.

Why exactly context-free grammars are used to describe the syntax of programming languages? Moreover, how does the source code, which is a sentence in context-free language, can describe such complex things like Turing machines?

Context-free grammars are used to describe the syntax because they are easy to understand and simple to implement. However, languages have two parts: syntax and semantics. The semantics of programming languages are context-sensitive, so the resulting language is not a context-free language.Your premise is false. Your question is equivalent to asking: “Why is ink on paper used to diagram gasoline-burning engines? How can you build an engine that’s going to burn gasoline from ink on paper?” You’re confusing one tool used in designing programming languages with the languages themselves.

What is the proper syntax for commands in the RUN dialog box for Windows?

If you're trying to open a command window and have it look a certain way, then you'll definitely have to change the syntax a bit. So, let's look at what you're doing first. I'm going to assume that the command line you've given us is literally what you're typing in the 'run' box. Let's break it down a bit,

1) cmd
If you enter this by itself, does a DOS command window open? If not, then you have some other issues. But for the sake of this question, I'll assume it works.

2) cmd [/C] [/T:fg]
Get rid of any and all square brackets [ ] .. those are used on the help screen to delimit the start and stop of the different command line options. They are not meant to be typed in.

3) cmd /C
This will execute whatever you want in a DOS command window, then immediately close the command window. That's why it's disappearing so quickly. If you want the DOS window to stay open then use,

cmd /K

4) /T:fg
The 'fg' are placeholder variables. 'f' means Foregroud, and 'g' means backGround. But 'fg' is not supposed to be typed in, it's just meant to show that there are two variables and their order. To actually use the /T option, then you'll need to look at the options on the COLOR command, use COLOR /? to see those.

So, for instance, if you wanted a blue background with white text, then you would enter

cmd /T:17

5) One last quirk, if you put the command and options in this order, you'll get an error.

cmd /K /T:17

The command options need to be switched around for this. I don't know why, has to do with how DOS processes the ":" symbol as a label or part of a drive name, or some such nonsense.

So the correct command with options to create a non-closing DOS window with a blue background and white text is:

cmd /T:17 /K

Finally) if you want your chosen colors to be persistent any time you open a dos window without have to type all those command options, then open a window with just

cmd

then, right click on the title bar of the DOS window and select "Properties". Make all the changes you want to many aspects of a DOS box, including background/font color, size, fonts, layout, etc. When you click "OK" to save, then you'll be prompted to save the properties .. choose "Save properties for future windows with the same title."

Hope this helps!

How would people describe Hemingway's writing style?

I think that Hemingway was one of the greatest novelists of our time. Writing in the concise, at times brutal, style that he did is not easy, and I think in many ways he used the English language to physically embody the emotional conflict that many men of his generation felt inside. His often short sentences are packed with power, like a punch, but his obsessively repeated imagery (the drunken scenes in The Sun Also Rises come to mind) speaks of a sort of emotional sloppiness — the man that feels desire and pain deeply, but can’t figure out how to express it, so he tries over and over to run away from himself.Hemingway also attempted to depict the tight conflicts between couples, and to address the fact that so little is really said out loud. He left the truths behind his stories to our imaginations, which I enjoy.In his own time Hemingway stood out for writing in his own way; this is also why some people couldn’t stand his books. I think he cherished writing, and he worked hard at crafting what he wrote, rather than crafting his “style.” Many people might describe his style as too terse or even superficial, particularly if you compare it to works by authors like Faulkner or Joyce.In the end Hemingway’s alcoholism and depression are great windows into a man who was messy and hurting, and who tried to express that through his art.

Describe diction in your own words?

choosing the right words, pronunciation of words in the proper way,

What is the syntax of an array?

Definition : An array stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type stored at contiguous memory locations.Instead of declaring individual variables, such as number0, number1, ..., and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and ..., numbers[99] to represent individual variables. A specific element in an array is accessed by an index.All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. Array is the collection of similar data typesDeclaring ArraysTo declare an array in C#, you can use the following syntax:datatype[] arrayName;
where,datatype is used to specify the type of elements in the array.[ ] specifies the rank of the array. The rank specifies the size of the array.arrayName specifies the name of the array.For example,Int [] intArray;
Initializing an ArrayDeclaring an array does not initialize the array in the memory. When the array variable is initialized, you can assign values to the array.Array is a reference type, so you need to use the new keyword to create an instance of the array. Fir exampleInt [] intArray = new intArray[5];
Here [] indicates that this is an array with the type of Int.[n] - n indicates length of an array.Storing value in the array :int [] intArray = new int[5];intArray[0] = 1;intArray[1] = 2;intArray[2] = 3;intArray[3] = 4;intArray[4] = 5;Thnaks !

Explain me the syntax in java?

Yes, the syntax is completely fine. However, no one would do this. I believe it was done this way to show various language features, rather than be the best way to do something.

Line 2 is three parts:
- creating a new array of integers: new int[]
- filling that array with three values: 1, 2, and 3.

Together, these two creates an array of three integers, with the values of 1, 2, and 3.

Since all arrays are Objects, an Object reference can be set to an array. Therefore:

- the variable "obj" of type "Object" is set to point to the new array.

This line demonstrates: the creation of a new array, array initialization, and assignment to a supertype (Object is a supertype of int[]).

Line 3:
This line demonstrates that even though "obj" is of type Object, the value it points to is still an integer array. Therefore, you can use a cast to refer to what "obj" points as an int[], then assign that value to "someArray".

This line demonstrates: Casting and that object references might point be a subclass of its own type.


In reality, lines 2 and 3 would be combined into:
int[] someArray = new int[] { 1, 2, 3 };

The use of "obj" is completely superfluous.

What is the difference between grammar and syntax?

As a linguist, I would say:- grammar is a normative/prescriptive approach to language. Grammar books are full of "don't say this" and "you should really say this like so and so", together with exception lists. Grammars are generally written by accomplished scholars, with an exceptional command of the subtleties of their language. Grammars are not generally thought of as theories about how any particular language works, much less a theory about how natural languages work in general. It's more like a cookbook for properly using a given language.- syntax is a linguistic discipline, hence it tries very hard not to be normative or prescriptive. So syntax is more descriptive than grammar, and it is based on more explicit criteria. For example, categories (parts of speech) will be defined based on their distributional profiles (which words they occur with, which words they alternate with) rather than based on a pre-theory of the world (eg.: nouns are immutable substances, verbs are actions involving substances, adjectives are properties of substances). Or based on the grammar of Greek or Latin (which is what happened for French grammar). The long-term objective of syntactic description is to form a unified, consistent and verifiable (i.e. formal) theory of how we can process (produce and understand) an infinity of new sentences based on a finite set of resources (rules, trees, Frames, constructions, patterns...). Formal syntactic theories are generally produced by recognized scholars, with a good command of the language they are trying to describe. Some of them use corpus data, too. Parts of formal syntactic theories can be implemented in real-life applications: natural language generators, information extraction systems, machine translation systems, etc. This being said, most syntacticians know a lot about grammar(s). The generativist syntacticians will generally think themselves as heirs to such grammarians as Antoine Arnauld & Claude Lancelot (Grammaire Raisonnée de Port-Royal, check it on Grammaire générale et raisonnée : contenant les fondements de l'art de parler... ([Reprod.]) / [A. Arnauld et Cl. Lancelot]). This is why the generativist approach to syntax is usually called "generative grammar". And the rules of a formal syntactic theory are usually called "grammar" rules...Yes, we linguists like to fret over such matters.

TRENDING NEWS