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


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

Re: What is a "primary expression"?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: What is a "primary expression"?
Date 2018-10-07 16:55 -0400
Organization A noiseless patient Spider
Message-ID <ppdrri$ebt$1@dont-email.me> (permalink)
References <primary-20181007171511@ram.dialup.fu-berlin.de>

Show all headers | View raw


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.

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web