Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38640 > unrolled thread

Re: What is a "primary expression"?

Started byEric Sosman <esosman@comcast-dot-net.invalid>
First post2018-10-07 16:55 -0400
Last post2018-10-07 16:55 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: What is a "primary expression"? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-10-07 16:55 -0400

#38640 — Re: What is a "primary expression"?

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2018-10-07 16:55 -0400
SubjectRe: What is a "primary expression"?
Message-ID<ppdrri$ebt$1@dont-email.me>
On 10/7/2018 12:24 PM, Stefan Ram wrote:
>    What is a "primary expression"?
> 
>    I know that, technically, it's defined by JLS11
>    "15.8 Primary Expressions" as
> 
> Primary:
> PrimaryNoNewArray
> ArrayCreationExpression
> 
>    . But what's the idea behind it? Can you
>    characterize it by specific properties?
> [...]

     The explanation in the JLS itself seems clear:

	Primary expressions include most of the simplest kinds of
	expressions, from which all others are constructed: literals,
	object creations, field accesses, method invocations, method
	references, and array accesses. [...]

Informally, PE's are the "building blocks" of expressions, the "atoms"
that operators and so on join to produce "molecules."  Whimsically,
PE's are the "bottommost turtles" of Java expressions.

     The JLS has some additional language to explain/defend the non-
inclusion of a few things that other languages consider "primary:"
for example, "identifier" is not a PE.  The reasons given seem to
be not really about the goals of Java but about simplifying a few
wrinkles in the grammar that describes it.

-- 
esosman@comcast-dot-net.invalid
Eight hundred thirty-six days to go.

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web