diff --git a/classad/_expression.py b/classad/_expression.py
index 14f2d3e..f63d257 100644
--- a/classad/_expression.py
+++ b/classad/_expression.py
@@ -206,19 +206,23 @@ class AttributeExpression(Expression):
         my: "Optional[ClassAd]" = None,
         target: "Optional[ClassAd]" = None,
     ) -> Any:
-        def find_scope(current_key):
+        def find_scope(current_key, classad=my):
             if len(current_key) > 0:
-                return my[current_key]
-            return my
+                return classad[current_key]
+            return classad
 
+        selected_classad = my
         value = Undefined()
         if self._expression[0] == ".":
             key = scope_up(self._expression[1])
             expression = self._expression[1][-1]
+        elif self._expression[0] == "target":
+            selected_classad = target
+            expression = self._expression[1]
         else:
             expression = self._expression
         try:
-            context = find_scope(key)
+            context = find_scope(key, classad=selected_classad)
         except TypeError:
             return Error()
         while isinstance(value, Undefined):
@@ -227,7 +231,7 @@ class AttributeExpression(Expression):
                 if len(key) == 0:
                     return Undefined()
                 key = scope_up(key)
-                context = find_scope(key)
+                context = find_scope(key, classad=selected_classad)
         if isinstance(value, AttributeExpression):
             return value._evaluate(key=key, my=my, target=target)
         return value
diff --git a/classad/_grammar.py b/classad/_grammar.py
index ef1413a..b08d4f5 100644
--- a/classad/_grammar.py
+++ b/classad/_grammar.py
@@ -41,6 +41,9 @@ undefined_literal = pp.CaselessKeyword("undefined").setParseAction(lambda: Undef
 parent_literal = pp.CaselessKeyword("parent").setParseAction(
     lambda s, l, t: NamedExpression.from_grammar(t[0])
 )
+my_literal = pp.CaselessKeyword("my").setParseAction(
+    lambda s, l, t: NamedExpression.from_grammar(t[0])
+)
 target_literal = pp.CaselessKeyword("target").setParseAction(
     lambda s, l, t: NamedExpression.from_grammar(t[0])
 )
diff --git a/docs/source/change/11.target_evaluation.yaml b/docs/source/change/11.target_evaluation.yaml
new file mode 100644
index 0000000..a3a46f8
--- /dev/null
+++ b/docs/source/change/11.target_evaluation.yaml
@@ -0,0 +1,10 @@
+category: added
+summary: "Evaluation of target classad"
+description: |
+  The project can now evaluate two classads in context. For this, the evaluation
+  of :py:class:`~.AttributeExpression`s implements the evaluation of the
+  :py:class:`~.NamedExpression` *target*.
+issues:
+  - 9
+pull requests:
+  - 11
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..89faa06
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,9 @@
+[aliases]
+test=pytest
+
+[flake8]
+statistics = True
+max-line-length = 80
+ignore = E501, B008, B011, W503
+select = C,E,F,W,B,B9
+exclude = docs,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg

Support evaluation of two classads in context
Until now only one classad can be evaluated, so the reference with ``my`` and ``target`` is not supported yet. This should be implemented.
diff --git a/classad_tests/test_matchmaking.py b/classad_tests/test_matchmaking.py
new file mode 100644
index 0000000..0403d2e
--- /dev/null
+++ b/classad_tests/test_matchmaking.py
@@ -0,0 +1,23 @@
+from classad import parse
+from classad._primitives import HTCInt
+
+
+def test_simple():
+    my_classad = parse("""rank = TARGET.Memory + TARGET.Mips """)
+    target_classad = parse(
+        """
+    Memory = 8
+    Mips = 10
+    """
+    )
+    assert my_classad.evaluate(
+        key="rank", my=my_classad, target=target_classad
+    ) == HTCInt(18)
+
+
+def test_nested():
+    my_classad = parse("""rank = TARGET.a.b + TARGET.c""")
+    target_classad = parse("""[c = 1; a = [b = 2; d = 1]]""")
+    assert my_classad.evaluate(
+        key="rank", my=my_classad, target=target_classad
+    ) == HTCInt(3)

pip install -e .[dev]
parse_log_pytest
pytest
pytest codecov
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///croot/attrs_1668696182826/work
certifi @ file:///croot/certifi_1671487769961/work/certifi
cfgv==3.3.1
charset-normalizer==3.4.1
-e git+https://github.com/MaineKuehn/classad.git@571c7bcad9b8301c8b8324d877bca10a02549833#egg=classad
codecov==2.1.13
coverage==7.2.7
distlib==0.3.9
filelock==3.12.2
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
identify==2.5.24
idna==3.10
importlib-metadata==6.7.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
nodeenv==1.9.1
packaging @ file:///croot/packaging_1671697413597/work
platformdirs==4.0.0
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
pre-commit==2.21.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing==3.1.4
pytest==7.1.2
PyYAML==6.0.1
requests==2.31.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.26.6
zipp @ file:///croot/zipp_1672387121353/work

name: classad
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cfgv==3.3.1
      - charset-normalizer==3.4.1
      - classad==0.2.0
      - codecov==2.1.13
      - coverage==7.2.7
      - distlib==0.3.9
      - filelock==3.12.2
      - identify==2.5.24
      - idna==3.10
      - importlib-metadata==6.7.0
      - nodeenv==1.9.1
      - platformdirs==4.0.0
      - pre-commit==2.21.0
      - pyparsing==3.1.4
      - pyyaml==6.0.1
      - requests==2.31.0
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.26.6
prefix: /opt/conda/envs/classad

classad_tests/test_matchmaking.py::test_simple classad_tests/test_matchmaking.py::test_nested
docs/source/change/11.target_evaluation.yaml classad/_grammar.py classad/_expression.py setup.cfg
docs/source/change/11.target_evaluation.yaml classad/_grammar.py classad/_expression.py setup.cfg