A text is a triple tau = (lambda, rho1, rho2) such that lambda is a la
beling function, and rho1, and rho2, are linear orders on the domain o
f lambda; hence tau may be seen as a word (lambda, rho1) together with
an additional linear order rho2 on the domain of lambda. The order rh
o2 is used to give to the word (lambda, rho1) its individual hierarchi
cal representation (syntactic structure) which may be a tree but it ma
y be also more general than a tree. In this paper we introduce context
-free grammars for texts and investigate their basic properties. Since
each text has its own individual structure, the role of such a gramma
r should be that of a definition of a pattern common to all individual
texts. This leads to the notion of a shapely context-free text gramma
r also investigated in this paper.