What does 'Language Construct' mean?

2019-01-22 18:48发布

I am learning C from 'Programming in C' by Stephen Kochan.

Though the author is careful from the beginning only not to confuse the students with jargon, but occasionally he has used few terms without explaining their meaning. I have figured out the meaning of many such terms with the help of internet.

However, I could not understand the exactly meaning of the phrase 'language construct', and unfortunately the web doesn't provide a good explanation.

Considering I am a beginner, what does 'language construct' mean?

标签: terminology
8条回答
疯言疯语
2楼-- · 2019-01-22 18:59

They are the base units from which the language is built up. They can't be used as a function rollback. They are directly called by the parser. It includes all the syntax, semantics and coding styles of a language. For more clarification you may refer to this question.

查看更多
叼着烟拽天下
3楼-- · 2019-01-22 18:59

In reference to a programming language

    Language Constructs mean the basic constructs of a programming languge e.g
1. Conditions (if, else, switch)
2. Loops (For, While, Do-while) etc
查看更多
姐就是有狂的资本
4楼-- · 2019-01-22 19:11

C is a structural language so while compiling your code everything thing goes statement by statement. Thus it becomes necessary to place your statement properly. This placing i.e. putting your statement correctly is your language construct else there may be syntax error or logical error.

查看更多
劫难
5楼-- · 2019-01-22 19:12

First, you need to understand what a constructed language is. All programming languages are constructed languages (read the reference). You may then read a little bit about compiler construction, including this reference as well.

Going back to your question, consider this: The English language (a natural language) has tokens 'A-Z/0-9/,;"...' which we use to build "WORDS" and we use languages rules to build sentences out of words. So, in the English language a construct is what we build out of tokens.

Consider this brick-and-mortar example: Imagine if you set out to build a house, the basic materials you might use are: sand, iron, wood, cement, water (just four for simplicity). Anything you build out of these 4 or 5+ items would be a "CONSTRUCT", which in turn helps you build your house.

I have intentionally omitted details to further simplify the answer; hope this is helpful.

查看更多
贼婆χ
6楼-- · 2019-01-22 19:12

Wikipedia definition:

A language construct is a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of a programming language. The term Language Constructs is often used as a synonym for control structure, and should not be confused with a function.

查看更多
做个烂人
7楼-- · 2019-01-22 19:15

Without seeing the context that the phrase is used in, I cannot be sure, but generally the phrase 'language construct' just means the combination of keywords, grammar and structure of a coding language. Basically, how to format/write/construct a piece of code.

查看更多
登录 后发表回答