스칼라 사양. Chapter 3, 기록 : 사양 - 올바른 용어 SimpleType [유형] [유형]의 용도는 무엇입니까?
Type ::= FunctionArgTypes ‘=>’ Type
| InfixType [ExistentialClause]
FunctionArgTypes ::= InfixType
| ‘(’ [ ParamType {‘,’ ParamType } ] ‘)’
ExistentialClause ::= ‘forSome’ ‘{’ ExistentialDcl
{semi ExistentialDcl} ‘}’
ExistentialDcl ::= ‘type’ TypeDcl
| ‘val’ ValDcl
InfixType ::= CompoundType {id [nl] CompoundType}
CompoundType ::= AnnotType {‘with’ AnnotType} [Refinement]
| Refinement
AnnotType ::= SimpleType {Annotation}
SimpleType ::= SimpleType TypeArgs
| SimpleType ‘#’ id
| StableId
| Path ‘.’ ‘type’
| ‘(’ Types ‘)’
TypeArgs ::= ‘[’ Types ‘]’
Types ::= Type {‘,’ Type}
이의 다음 다시 작성을 생각해 보자 :
Type
InfixType
CompundType
AnnotType
SimpleType
SimpleType [Type]
SimpleType [Type] [Type]
그래서 SimpleType [Type] [Type]
유효한 유형을 보인다. 적어도이 문법에서는 유효한 문장이 될 것입니다. 올바르게 이해할 수 있습니까?
이러한 형식 식은 어떤 용도로 사용됩니까?
다른 말로하면 SimpleType [Type] [Type]
인 스칼라 프로그램을 작성하고 컴파일 할 수 있습니까?
그렇다면 어떻게됩니까? 그렇지 않다면 왜 안 되겠습니까? 유효하지 않는 한
는 스칼라의 문법에
SimpleType ::= SimpleType TypeArgs
을 갖는 점은 무엇입니까? 이 문법적으로는 AST로 해석 될 것입니다,하지만이 - -
재 작성 순서가 잘못되었습니다. –
무엇이 잘못 되었나요? – jhegedus