Search Results

Search found 4 results on 1 pages for 'metalanguage'.

Page 1/1 | 1 

  • Metalanguage like BNF or XML-Schema to validate a tree-instance against a tree-model

    - by Stefan
    Hi! I'm implementing a new machine learning algorithm in Java that extracts a prototype datastructure from a set of structured datasets (tree-structure). As im developing a generic library for that purpose, i kept my design independent from concrete data-representations like XML. My problem now is that I need a way to define a data model, which is basically a ruleset describing valid trees, against which a set of trees is being matched. I thought of using BNF or a similar dialect. Basically I need a way to iterate through the space of all valid TreeNodes defined by the ModelTree (Like a search through the search space for algorithms like A*) so that i can compare my set of concrete trees with the model. I know that I'll have to deal with infinite spaces there but first things first. I know, it's rather tricky (and my sentences are pretty bumpy) but I would appreciate any clues. Thanks in advance, Stefan

    Read the article

  • How do I parse a templated string in Python?

    - by mLewisLogic
    I'm new to Python, so I'm not sure exactly what this operation is called, hence I'm having a hard time searching for information in it. Basically I'd like to have a string such as: "[[size]] widget that [[verb]] [[noun]]" Where size, verb, and noun are each a list. I'd like to interpret the string as a metalanguage, such that I can make lots of sentences out permutations from the lists. As a metalanguage, I'd also be able to make other strings that use those pre-defined lists to generate more permutations. Are there any capabilities for variable substitution like this in Python? What term describes this operation if I should just Google it?

    Read the article

  • Class as first-class object

    - by mrpyo
    Could a class be a first-class object? If yes, how would the implementation look? I mean, how could syntax for dynamically creating new classes look like? EDIT: I mean what example syntax could look like (I'm sorry, English is not my native language), but still I believe this question makes sense - how you give this functionality while keeping language consistent. For example how you create reference for new type. Do you make reference first-class object too and then use something like this: Reference<newType> r = new Reference<newType>(); r.set(value); Well this could get messy so you may just force user to use Object type references for dynamically created classes, but then you loose type-checking. I think creating concise syntax for this is interesting problem which solving could lead to better language design, maybe language which is metalanguage for itself (I wonder if this is possible).

    Read the article

1